Set errno to 0 before calling strtol. (#306388, Morten Welinder)

2005-06-09  Matthias Clasen  <mclasen@redhat.com>

	* glib/goption.c (parse_int): Set errno to 0 before calling
	strtol.  (#306388, Morten Welinder)
This commit is contained in:
Matthias Clasen 2005-06-09 15:39:29 +00:00 committed by Matthias Clasen
parent f15bb122ce
commit e90cd618b1
5 changed files with 30 additions and 5 deletions

View 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

View 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

View 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

View 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

View File

@ -33,18 +33,22 @@
#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')
{