[PATCH 2/6] vsh: Refactor vshCommandOptScaledInt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]