]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
util: conf: Clarify choice between VIR_CONF_LONG and VIR_CONF_ULONG
authorAndrea Bolognani <abologna@redhat.com>
Fri, 15 Jul 2016 15:20:03 +0000 (17:20 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Mon, 18 Jul 2016 13:49:57 +0000 (15:49 +0200)
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

index f2d543c4ff39c81f90549e7307df12f7bdf984a8..eb55a1a16bda9c3ee341fbe1a4080875c5863842 100644 (file)
@@ -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 {