[libvirt] [PATCH 2/6] vsh: Refactor vshCommandOptScaledInt

Peter Krempa pkrempa at redhat.com
Fri Mar 18 08:57:01 UTC 2016


Fix control flow and spacing issues.
---
 tools/vsh.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/tools/vsh.c b/tools/vsh.c
index 047a0cc..cbe8189 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;
 }


-- 
2.7.3




More information about the libvir-list mailing list