From: Ulrich Drepper Date: Sat, 23 Aug 1997 21:51:19 +0000 (+0000) Subject: (__srandom_r): Don't use seed 0. Use 1 in this case. X-Git-Tag: cvs/glibc-2_0_5pre5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=944599f7c3fc2e867452a39ce0e3ae01159c477d;p=thirdparty%2Fglibc.git (__srandom_r): Don't use seed 0. Use 1 in this case. --- diff --git a/stdlib/random_r.c b/stdlib/random_r.c index 58f5153936a..6355097a936 100644 --- a/stdlib/random_r.c +++ b/stdlib/random_r.c @@ -127,7 +127,8 @@ __srandom_r (x, buf) if (buf == NULL || buf->rand_type < TYPE_0 || buf->rand_type > TYPE_4) return -1; - buf->state[0] = x; + /* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */ + buf->state[0] = x ? x : 1; if (buf->rand_type != TYPE_0) { long int i;