a bit about gnome-libs



I took a brief look at the Gnome libs.  The first thing to report is
the bug with alloca in popt I mentioned some time ago.  I append a
patch below (including an optimization for glibc 2.1).

The second point is that there are lots of uses of strtok() in the
libraries.  I think libraries should be designed right from the
beginning to be thread-safe.  Therefore use strtok_r() or strsep().  A
replacement for system which do not have any of these functions is
easily written.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--- support/popt.c-save	Tue Dec 29 11:26:08 1998
+++ support/popt.c	Tue Dec 29 11:30:07 1998
@@ -308,9 +308,12 @@
 	    }
 
 	    /* Make a copy we can hack at */
-	    localOptString = optString = 
-			strcpy(alloca(strlen(origOptString) + 1), 
-			origOptString);
+#ifdef strdupa
+	    localOptString = optString = strdupa (origOptString);
+#else
+	    localOptString = optString = alloca(strlen(origOptString) + 1);
+	    strcpy(optString, origOptString);
+#endif
 
 	    if (!optString[0])
 		return POPT_ERROR_BADOPT;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]