[PATCH 7/8] util: conf: Clarify choice between VIR_CONF_LONG and VIR_CONF_ULONG

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

 



We use unsigned long long integers unless we need to store a
negative value. Rewrite the condition to make this more obvious.
---
 src/util/virconf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virconf.c b/src/util/virconf.c
index f2d543c..eb55a1a 100644
--- a/src/util/virconf.c
+++ b/src/util/virconf.c
@@ -545,7 +545,7 @@ virConfParseValue(virConfParserCtxtPtr ctxt)
                          _("numbers not allowed in VMX format"));
             return NULL;
         }
-        type = (c_isdigit(CUR) || CUR == '+') ? VIR_CONF_ULONG : VIR_CONF_LONG;
+        type = (CUR == '-') ? VIR_CONF_LONG : VIR_CONF_ULONG;
         if (virConfParseLong(ctxt, &l) < 0)
             return NULL;
     } else {
-- 
2.7.4

--
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]