From 44956139baf7aaabd7916b0266c9584d7795c87d Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 28 Oct 1999 22:23:31 +0000 Subject: [PATCH] (rand_r): Really use 31 bits, the result was shifted a bit too much. --- stdlib/rand_r.c | 4 ++-- 1 file 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 , 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;