From a8ff1b4fcef1e2c53603b30b918304f7be9f27b4 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Wed, 10 Feb 1999 08:06:26 +0000 Subject: fixed errernerous code wrt to thread specific error string allocation Wed Feb 10 07:56:33 1999 Tim Janik * gmodule.c (g_module_error): fixed errernerous code wrt to thread specific error string allocation handling. Wed Feb 10 06:20:30 1999 Tim Janik * gmutex.c (g_static_private_set): invoke destroy notifier when overwriting values, initialize new array fields with NULL. (g_static_private_free_data): do not skip destroy notification for data == NULL. * gutils.c (g_direct_equal): compare pointer values directly instead of just their guint values which is a loosing conversion for sizeof(gpointer)==8 systems. (g_get_any_init): restructured code so we don't use endless loops like while (1), which boil down to an ugly alias for goto. strip ,.* from the real name. --- gstrfuncs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gstrfuncs.c') diff --git a/gstrfuncs.c b/gstrfuncs.c index 0a1648515..32fdeb52f 100644 --- a/gstrfuncs.c +++ b/gstrfuncs.c @@ -644,13 +644,14 @@ g_strerror (gint errnum) #endif /* NO_SYS_ERRLIST */ msg = g_static_private_get (&msg_private); - if( !msg ) + if (!msg) { - msg = g_new( gchar, 64 ); + msg = g_new (gchar, 64); g_static_private_set (&msg_private, msg, g_free); } sprintf (msg, "unknown error (%d)", errnum); + return msg; } @@ -770,13 +771,14 @@ g_strsignal (gint signum) #endif /* NO_SYS_SIGLIST */ msg = g_static_private_get (&msg_private); - if( !msg ) + if (!msg) { - msg = g_new( gchar, 64 ); + msg = g_new (gchar, 64); g_static_private_set (&msg_private, msg, g_free); } sprintf (msg, "unknown signal (%d)", signum); + return msg; } -- cgit v1.2.3