From 0e884de8725a6950c957b55eeff7c8c8bf733008 Mon Sep 17 00:00:00 2001 From: Nathael Pajani Date: Mon, 16 Apr 2012 19:15:03 +0200 Subject: [PATCH] Fixing lookup of command name in table --- isp_commands.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/isp_commands.c b/isp_commands.c index 8c886ab..35ac62a 100644 --- a/isp_commands.c +++ b/isp_commands.c @@ -784,15 +784,14 @@ int isp_handle_command(char* cmd, int arg_count, char** args) } index++; } - if (arg_count != isp_cmds_list[cmd_found].nb_args) { - isp_warn_trailing_args(cmd_found, arg_count, args); - } - ret = isp_cmds_list[cmd_found].handler(arg_count, args); - if (cmd_found == -1) { printf("Unknown command \"%s\", use -h or --help for a list.\n", cmd); return -2; } + if (arg_count != isp_cmds_list[cmd_found].nb_args) { + isp_warn_trailing_args(cmd_found, arg_count, args); + } + ret = isp_cmds_list[cmd_found].handler(arg_count, args); return ret; } -- 2.43.0