From: Jonathan Neuschäfer Date: Wed, 21 Dec 2011 20:40:52 +0000 (+0100) Subject: command.c: rework loop logic in find_key_command X-Git-Tag: release-0.20~40 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4085b6e245ca844d10de7de25a4d1fa32f2b1b9a;p=ncmpc.git command.c: rework loop logic in find_key_command --- 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)