strfry

Andreas Schwab schwab@suse.de
Fri Mar 31 03:08:00 GMT 2000


strfry didn't use initstate_r correctly.

2000-03-31  Andreas Schwab  <schwab@suse.de>

	* string/strfry.c: Declare STATE as array of char instead of int
	and do not initialize it (done by initstate_r).  Pass correct
	size.

Index: string/strfry.c
===================================================================
RCS file: /cvs/glibc/libc/string/strfry.c,v
retrieving revision 1.4
diff -u -a -u -r1.4 string/strfry.c
--- string/strfry.c	1999/04/28 22:47:29	1.4
+++ string/strfry.c	2000/03/31 11:02:13
@@ -29,9 +29,9 @@
 
   if (!init)
     {
-      static int state[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
+      static char state[32];
       rdata.state = NULL;
-      __initstate_r (time ((time_t *) NULL), state, 8, &rdata);
+      __initstate_r (time ((time_t *) NULL), state, sizeof (state), &rdata);
       init = 1;
     }
 

Andreas.

-- 
Andreas Schwab                                  "And now for something
SuSE Labs                                        completely different."
Andreas.Schwab@suse.de
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg


More information about the Libc-hacker mailing list