From 68c2022ad7cf4b1adfdc903d4650b98ed598a79e Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Wed, 10 Jul 2024 23:57:19 +0100 Subject: [PATCH] return quickcommands + i --- src/util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.c b/src/util.c index fa68b82..e95ce98 100644 --- a/src/util.c +++ b/src/util.c @@ -97,9 +97,9 @@ struct quickcommand *command_in_quickcommands(const char *command_key, const str { for (int i = 0; i < n; i++) { - if (strncmp(command_key, quickcommands[i].name, strlen(command_key)) == 0) + if (strcmp(command_key, quickcommands[i].name) == 0) { - return (struct quickcommand *)&quickcommands[i]; + return (struct quickcommand *)(quickcommands + i); } } return NULL;