[libgovirt] Use G_MAXUINT instead of G_MAXUINT32 as max guint value



commit dbc512c766829089888cd54780fb0ce646f903be
Author: Christophe Fergeau <cfergeau redhat com>
Date:   Mon Dec 9 18:35:55 2013 +0100

    Use G_MAXUINT instead of G_MAXUINT32 as max guint value
    
    ovirt_utils_guint_from_string() converts a guint from a string, but was
    reporting overflow when the converted value is bigger than G_MAXUINT32.
    As we are handling a guint, it's better to use G_MAXUINT as the limit.

 govirt/ovirt-utils.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/govirt/ovirt-utils.c b/govirt/ovirt-utils.c
index 3b9593a..3213c3c 100644
--- a/govirt/ovirt-utils.c
+++ b/govirt/ovirt-utils.c
@@ -163,7 +163,7 @@ ovirt_utils_guint_from_string(const char *value_str, guint *value)
     if (!success) {
         return FALSE;
     }
-    if (value64 > G_MAXUINT32) {
+    if (value64 > G_MAXUINT) {
         return FALSE;
     }
 


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