(__srandom_r): Don't use seed 0. Use 1 in this case.

This commit is contained in:
Ulrich Drepper 1997-08-23 21:51:19 +00:00
parent a0fcfbc608
commit 944599f7c3

View File

@ -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;