Code

command.c: rework loop logic in find_key_command
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 21 Dec 2011 20:40:52 +0000 (21:40 +0100)
committerJonathan Neuschäfer <j.neuschaefer@gmx.net>
Wed, 21 Dec 2011 20:40:52 +0000 (21:40 +0100)
src/command.c

index 82232aff6ba49e3a0499ed2b42d28e55780d446c..6d06368123e47918c02dcd083eae8e0b7a124cbe 100644 (file)
@@ -427,7 +427,10 @@ find_key_command(int key, command_definition_t *c)
 {
        int i = 0;
 
-       while (key && c && c[i].name) {
+       assert(key != 0);
+       assert(c != NULL);
+
+       while (c[i].name) {
                if (c[i].keys[0] == key ||
                    c[i].keys[1] == key ||
                    c[i].keys[2] == key)