Don't leave out parameters uninitialized. (#490061, Benjamin Otte)

2007-11-08  Matthias Clasen <mclasen@redhat.com>

        * glib/gstrfuncs.c (g_parse_long_long): Don't leave
        out parameters uninitialized.  (#490061, Benjamin Otte)


svn path=/branches/glib-2-14/; revision=5824
This commit is contained in:
Matthias Clasen
2007-11-08 13:35:02 +00:00
committed by Matthias Clasen
parent a9c034f68d
commit 2afc38c88f
2 changed files with 8 additions and 1 deletions

View File

@@ -1,3 +1,8 @@
2007-11-08 Matthias Clasen <mclasen@redhat.com>
* glib/gstrfuncs.c (g_parse_long_long): Don't leave
out parameters uninitialized. (#490061, Benjamin Otte)
2007-11-07 Matthias Clasen <mclasen@redhat.com> 2007-11-07 Matthias Clasen <mclasen@redhat.com>
=== Branch for 2.14 === === Branch for 2.14 ===

View File

@@ -650,9 +650,12 @@ g_parse_long_long (const gchar *nptr,
g_return_val_if_fail (nptr != NULL, 0); g_return_val_if_fail (nptr != NULL, 0);
*negative = FALSE;
if (base == 1 || base > 36) if (base == 1 || base > 36)
{ {
errno = EINVAL; errno = EINVAL;
if (endptr)
*endptr = nptr;
return 0; return 0;
} }
@@ -666,7 +669,6 @@ g_parse_long_long (const gchar *nptr,
goto noconv; goto noconv;
/* Check for a sign. */ /* Check for a sign. */
*negative = FALSE;
if (*s == '-') if (*s == '-')
{ {
*negative = TRUE; *negative = TRUE;