diff options
Diffstat (limited to 'src/command.c')
-rw-r--r-- | src/command.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/command.c b/src/command.c index d0d141904..a565c25ec 100644 --- a/src/command.c +++ b/src/command.c @@ -383,21 +383,21 @@ get_key_command_from_name(char *name) } -command_t +command_t find_key_command(int key, command_definition_t *cmds) { - int i; + int i; + + i=0; + while (key && cmds && cmds[i].name) { + if (cmds[i].keys[0] == key || + cmds[i].keys[1] == key || + cmds[i].keys[2] == key) + return cmds[i].command; + i++; + } - i=0; - while( key && cmds && cmds[i].name ) - { - if( cmds[i].keys[0] == key || - cmds[i].keys[1] == key || - cmds[i].keys[2] == key ) - return cmds[i].command; - i++; - } - return CMD_NONE; + return CMD_NONE; } command_t |