diff --git a/tools/vsh.c b/tools/vsh.c index 047a0ccd854ba7f3ffac9069035d031186a89b90..cbe8189986827624f36961d710f3abd531e56f76 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -1143,18 +1143,16 @@ vshCommandOptScaledInt(vshControl *ctl, const vshCmd *cmd, if ((ret = vshCommandOpt(cmd, name, &arg, true)) <= 0) return ret; + if (virStrToLong_ullp(arg->data, &end, 10, value) < 0 || - virScaleInteger(value, end, scale, max) < 0) - { + virScaleInteger(value, end, scale, max) < 0) { vshError(ctl, _("Scaled numeric value '%s' for <%s> option is malformed or " "out of range"), arg->data, name); - ret = -1; - } else { - ret = 1; + return -1; } - return ret; + return 1; }