diff options
author | Luiz Capitulino <lcapitulino@redhat.com> | 2009-06-09 18:21:54 -0300 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2009-06-10 19:45:49 +0300 |
commit | 411908d03b2c081429356a1179a0c78591494068 (patch) | |
tree | 8c80d3d1560100f2aab66516dd6aef685851e829 | |
parent | fdffd87070dab521c0312e09e10b41692abff91e (diff) | |
download | qemu-411908d03b2c081429356a1179a0c78591494068.tar.gz qemu-411908d03b2c081429356a1179a0c78591494068.tar.bz2 qemu-411908d03b2c081429356a1179a0c78591494068.zip |
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>
-rw-r--r-- | monitor.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; |