diff --git a/ChangeLog b/ChangeLog index c92a5b999..5375461ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-06-09 Matthias Clasen + + * glib/goption.c (parse_int): Set errno to 0 before calling + strtol. (#306388, Morten Welinder) + 2005-06-08 Tor Lillqvist * glib/gutils.c (get_windows_directory_root): New helper function diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index c92a5b999..5375461ac 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-06-09 Matthias Clasen + + * glib/goption.c (parse_int): Set errno to 0 before calling + strtol. (#306388, Morten Welinder) + 2005-06-08 Tor Lillqvist * glib/gutils.c (get_windows_directory_root): New helper function diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index c92a5b999..5375461ac 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,8 @@ +2005-06-09 Matthias Clasen + + * glib/goption.c (parse_int): Set errno to 0 before calling + strtol. (#306388, Morten Welinder) + 2005-06-08 Tor Lillqvist * glib/gutils.c (get_windows_directory_root): New helper function diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index c92a5b999..5375461ac 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2005-06-09 Matthias Clasen + + * glib/goption.c (parse_int): Set errno to 0 before calling + strtol. (#306388, Morten Welinder) + 2005-06-08 Tor Lillqvist * glib/gutils.c (get_windows_directory_root): New helper function diff --git a/glib/goption.c b/glib/goption.c index 2f6c7c227..86e404c76 100644 --- a/glib/goption.c +++ b/glib/goption.c @@ -610,10 +610,11 @@ 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') { g_set_error (error,