mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
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.
This commit is contained in:
parent
649ecb704f
commit
55b46920bb
@ -3053,12 +3053,15 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
case ':':
|
case ':':
|
||||||
for (i = 0; opt[i].name != NULL; i++) {
|
for (i = 0; opt[i].name != NULL; i++) {
|
||||||
if (opt[i].val == optopt) {
|
if (opt[i].val == optopt)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (opt[i].name)
|
||||||
vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
|
vshError(ctl, _("option '-%c'/'--%s' requires an argument"),
|
||||||
optopt, opt[i].name);
|
optopt, opt[i].name);
|
||||||
|
else
|
||||||
|
vshError(ctl, _("option '-%c' requires an argument"), optopt);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
|
||||||
}
|
|
||||||
case '?':
|
case '?':
|
||||||
if (optopt)
|
if (optopt)
|
||||||
vshError(ctl, _("unsupported option '-%c'. See --help."), optopt);
|
vshError(ctl, _("unsupported option '-%c'. See --help."), optopt);
|
||||||
|
Loading…
Reference in New Issue
Block a user