]> xenbits.xensource.com Git - libvirt.git/commitdiff
vsh: Refactor vshCommandOptScaledInt
authorPeter Krempa <pkrempa@redhat.com>
Thu, 17 Mar 2016 14:45:09 +0000 (15:45 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 29 Mar 2016 13:28:46 +0000 (15:28 +0200)
Fix control flow and spacing issues.

tools/vsh.c

index 047a0ccd854ba7f3ffac9069035d031186a89b90..cbe8189986827624f36961d710f3abd531e56f76 100644 (file)
@@ -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;
 }