mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-26 05:56:14 +01:00
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:
parent
f15bb122ce
commit
e90cd618b1
@ -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>
|
2005-06-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/gstdio.h
|
* glib/gstdio.h
|
||||||
|
@ -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>
|
2005-06-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/gstdio.h
|
* glib/gstdio.h
|
||||||
|
@ -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>
|
2005-06-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/gstdio.h
|
* glib/gstdio.h
|
||||||
|
@ -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>
|
2005-06-09 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/gstdio.h
|
* glib/gstdio.h
|
||||||
|
@ -33,18 +33,22 @@
|
|||||||
|
|
||||||
#define TRANSLATE(group, str) (((group)->translate_func ? (* (group)->translate_func) ((str), (group)->translate_data) : (str)))
|
#define TRANSLATE(group, str) (((group)->translate_func ? (* (group)->translate_func) ((str), (group)->translate_data) : (str)))
|
||||||
|
|
||||||
typedef struct {
|
typedef struct
|
||||||
|
{
|
||||||
GOptionArg arg_type;
|
GOptionArg arg_type;
|
||||||
gpointer arg_data;
|
gpointer arg_data;
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
gboolean bool;
|
gboolean bool;
|
||||||
gint integer;
|
gint integer;
|
||||||
gchar *str;
|
gchar *str;
|
||||||
gchar **array;
|
gchar **array;
|
||||||
} prev;
|
} prev;
|
||||||
union {
|
union
|
||||||
|
{
|
||||||
gchar *str;
|
gchar *str;
|
||||||
struct {
|
struct
|
||||||
|
{
|
||||||
gint len;
|
gint len;
|
||||||
gchar **data;
|
gchar **data;
|
||||||
} array;
|
} array;
|
||||||
@ -628,9 +632,10 @@ parse_int (const gchar *arg_name,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *end;
|
gchar *end;
|
||||||
glong tmp = strtol (arg, &end, 0);
|
glong tmp;
|
||||||
|
|
||||||
errno = 0;
|
errno = 0;
|
||||||
|
tmp = strtol (arg, &end, 0);
|
||||||
|
|
||||||
if (*arg == '\0' || *end != '\0')
|
if (*arg == '\0' || *end != '\0')
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user