mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
vsh: Refactor vshCommandOptScaledInt
Fix control flow and spacing issues.
This commit is contained in:
parent
b2c9d77b4e
commit
3f1b45de24
10
tools/vsh.c
10
tools/vsh.c
@ -1143,18 +1143,16 @@ vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd,
|
|||||||
|
|
||||||
if ((ret = vshCommandOpt(cmd, name, &arg, true)) <= 0)
|
if ((ret = vshCommandOpt(cmd, name, &arg, true)) <= 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (virStrToLong_ullp(arg->data, &end, 10, value) < 0 ||
|
if (virStrToLong_ullp(arg->data, &end, 10, value) < 0 ||
|
||||||
virScaleInteger(value, end, scale, max) < 0)
|
virScaleInteger(value, end, scale, max) < 0) {
|
||||||
{
|
|
||||||
vshError(ctl,
|
vshError(ctl,
|
||||||
_("Scaled numeric value '%s' for <%s> option is malformed or "
|
_("Scaled numeric value '%s' for <%s> option is malformed or "
|
||||||
"out of range"), arg->data, name);
|
"out of range"), arg->data, name);
|
||||||
ret = -1;
|
return -1;
|
||||||
} else {
|
|
||||||
ret = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user