monitor: Remove uneeded goto

The 'found' goto in monitor_handle_command() can be dropped if we check
for 'cmd->name' after looking up for the command to execute.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
Luiz Capitulino 2009-06-09 18:21:54 -03:00 committed by Blue Swirl
parent 3a41759da3
commit d91d9bf617
1 changed files with 6 additions and 4 deletions

View File

@ -2432,11 +2432,13 @@ static void monitor_handle_command(Monitor *mon, const char *cmdline)
/* find the command */
for(cmd = mon_cmds; cmd->name != NULL; cmd++) {
if (compare_cmd(cmdname, cmd->name))
goto found;
break;
}
if (cmd->name == NULL) {
monitor_printf(mon, "unknown command: '%s'\n", cmdname);
return;
}
monitor_printf(mon, "unknown command: '%s'\n", cmdname);
return;
found:
for(i = 0; i < MAX_ARGS; i++)
str_allocated[i] = NULL;