Set errno to 0 before calling strtol. (#306388, Morten Welinder)
authorMatthias Clasen <mclasen@redhat.com>
Thu, 9 Jun 2005 15:39:29 +0000 (15:39 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 9 Jun 2005 15:39:29 +0000 (15:39 +0000)
2005-06-09  Matthias Clasen  <mclasen@redhat.com>

* glib/goption.c (parse_int): Set errno to 0 before calling
strtol.  (#306388, Morten Welinder)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-8
glib/goption.c

index 0a4efe8..c433fbe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_int): Set errno to 0 before calling
+       strtol.  (#306388, Morten Welinder)
+
 2005-06-09  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h
index 0a4efe8..c433fbe 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_int): Set errno to 0 before calling
+       strtol.  (#306388, Morten Welinder)
+
 2005-06-09  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h
index 0a4efe8..c433fbe 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_int): Set errno to 0 before calling
+       strtol.  (#306388, Morten Welinder)
+
 2005-06-09  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h
index 0a4efe8..c433fbe 100644 (file)
@@ -1,3 +1,8 @@
+2005-06-09  Matthias Clasen  <mclasen@redhat.com>
+
+       * glib/goption.c (parse_int): Set errno to 0 before calling
+       strtol.  (#306388, Morten Welinder)
+
 2005-06-09  Tor Lillqvist  <tml@novell.com>
 
        * glib/gstdio.h
index 60303c5..4f2d2b6 100644 (file)
 
 #define TRANSLATE(group, str) (((group)->translate_func ? (* (group)->translate_func) ((str), (group)->translate_data) : (str)))
 
-typedef struct {
+typedef struct 
+{
   GOptionArg arg_type;
   gpointer arg_data;  
-  union {
+  union 
+  {
     gboolean bool;
     gint integer;
     gchar *str;
     gchar **array;
   } prev;
-  union {
+  union 
+  {
     gchar *str;
-    struct {
+    struct 
+    {
       gint len;
       gchar **data;
     } array;
@@ -628,9 +632,10 @@ parse_int (const gchar *arg_name,
           GError     **error)
 {
   gchar *end;
-  glong tmp = strtol (arg, &end, 0);
+  glong tmp;
 
   errno = 0;
+  tmp = strtol (arg, &end, 0);
   
   if (*arg == '\0' || *end != '\0')
     {