about summary refs log tree commit diff
path: root/stdlib/rand_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-28 21:10:55 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-28 21:10:55 +0000
commit253d0b23775e5627d0d2d9419ba51fc33addf7dd (patch)
treee946e8a302fcfe5017d9514fa7e32b1ce8d55ffe /stdlib/rand_r.c
parent8dd1e494527b0df2b5c18446d329cc51a1fd8584 (diff)
downloadglibc-253d0b23775e5627d0d2d9419ba51fc33addf7dd.tar.gz
glibc-253d0b23775e5627d0d2d9419ba51fc33addf7dd.tar.xz
glibc-253d0b23775e5627d0d2d9419ba51fc33addf7dd.zip
Update.
1999-10-27  Andreas Jaeger  <aj@suse.de>

	* stdlib/rand_r.c (rand_r): Really use 31 bits, the result was
	shifted a bit too much.
	Reported by Eugen Dedu <dedu@ese-metz.fr>.
Diffstat (limited to 'stdlib/rand_r.c')
-rw-r--r--stdlib/rand_r.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/rand_r.c b/stdlib/rand_r.c
index 3e0b8b2bc0..00c619a830 100644
--- a/stdlib/rand_r.c
+++ b/stdlib/rand_r.c
@@ -1,5 +1,5 @@
 /* Reentrant random function frm POSIX.1c.
-   Copyright (C) 1996 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -35,7 +35,7 @@ rand_r (unsigned int *seed)
 
   next *= 1103515245;
   next += 12345;
-  result <<= 11;
+  result <<= 10;
   result ^= (unsigned int) (next / 65536) % 1024;
 
   next *= 1103515245;