提交 55b46920 编写于 作者: J John Ferlan

virsh: Resolve Coverity 'MISSING_BREAK'

Recent commit '53531e16' resulted in a new Coverity warning regarding
a missing break in the ':' options processing. Adjust the commit to
avoid the issue.
上级 649ecb70
......@@ -3053,12 +3053,15 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
break;
case ':':
for (i = 0; opt[i].name != NULL; i++) {
if (opt[i].val == optopt) {
vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
optopt, opt[i].name);
exit(EXIT_FAILURE);
}
if (opt[i].val == optopt)
break;
}
if (opt[i].name)
vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
optopt, opt[i].name);
else
vshError(ctl, _("option '-%c' requires an argument"), optopt);
exit(EXIT_FAILURE);
case '?':
if (optopt)
vshError(ctl, _("unsupported option '-%c'. See --help."), optopt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册