提交 d91d9bf6 编写于 作者: L Luiz Capitulino 提交者: Blue Swirl

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: NLuiz Capitulino <lcapitulino@redhat.com>
上级 3a41759d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册