stlink_gui: Fix compiler warning on overflow
authorJerry Jacobs <jerry.jacobs@xor-gate.org>
Mon, 16 May 2016 13:55:34 +0000 (15:55 +0200)
committerJerry Jacobs <jerry.jacobs@xor-gate.org>
Mon, 16 May 2016 13:55:34 +0000 (15:55 +0200)
src/tools/gui/stlink-gui.c

index fd1cdf937c7f739829e3dc55bf8192a3b05fca73..247373e9d4f8a116e12eb8e314bd40f042b15282 100644 (file)
@@ -1,5 +1,6 @@
 #include <string.h>
 #include <stdlib.h>
+#include <stdint.h>
 #include <errno.h>
 #include <gtk/gtk.h>
 
@@ -183,14 +184,14 @@ hexstr_to_guint32 (const gchar *str, GError **err)
                 g_quark_from_string ("hextou32"),
                 1,
                 "Invalid hexstring");
-        return LONG_MAX;
+        return UINT32_MAX;
     }
     if (end_ptr == str) {
         g_set_error (err,
                 g_quark_from_string ("hextou32"),
                 2,
                 "Invalid hexstring");
-        return LONG_MAX;
+        return UINT32_MAX;
     }
     return val;
 }