mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-26 05:52:16 +01:00
Avoid using stderr to be as robust as possible in out-of-memory.
Thu May 10 23:21:30 2001 Owen Taylor <otaylor@redhat.com> * gmessages.c (g_log_write_prefix): Avoid using stderr to be as robust as possible in out-of-memory. * gmessages.c (g_log_default_handler): Remove some dead code. * gutils.c (g_parse_debug_string): Fix to avoid mallocs.
This commit is contained in:
14
gutils.c
14
gutils.c
@@ -437,9 +437,8 @@ g_parse_debug_string (const gchar *string,
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *str = g_strdup (string);
|
||||
gchar *p = str;
|
||||
gchar *q;
|
||||
const gchar *p = string;
|
||||
const gchar *q;
|
||||
gboolean done = FALSE;
|
||||
|
||||
while (*p && !done)
|
||||
@@ -451,16 +450,13 @@ g_parse_debug_string (const gchar *string,
|
||||
done = TRUE;
|
||||
}
|
||||
|
||||
*q = 0;
|
||||
|
||||
for (i=0; i<nkeys; i++)
|
||||
if (!g_strcasecmp(keys[i].key, p))
|
||||
if (g_strncasecmp(keys[i].key, p, q - p) == 0 &&
|
||||
keys[i].key[q - p] == '\0')
|
||||
result |= keys[i].value;
|
||||
|
||||
p = q+1;
|
||||
p = q + 1;
|
||||
}
|
||||
|
||||
g_free (str);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user