From: Luiz Capitulino Date: Tue, 9 Jun 2009 21:21:54 +0000 (-0300) Subject: monitor: Remove uneeded goto X-Git-Tag: v0.11.0-rc0~438 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d91d9bf617aa560082d7d5c5f405d6b70f7b42c9;p=thirdparty%2Fqemu.git 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 --- diff --git a/monitor.c b/monitor.c index 7620bdebfe8..fd9175257ab 100644 --- a/monitor.c +++ b/monitor.c @@ -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;