From 4085b6e245ca844d10de7de25a4d1fa32f2b1b9a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonathan=20Neusch=C3=A4fer?= Date: Wed, 21 Dec 2011 21:40:52 +0100 Subject: [PATCH] command.c: rework loop logic in find_key_command --- src/command.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index 82232af..6d06368 100644 --- a/src/command.c +++ b/src/command.c @@ -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) -- 2.30.2