This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

strfry


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]