mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-12 14:21:18 +08:00
(__srandom_r): Don't use seed 0. Use 1 in this case.
This commit is contained in:
parent
a0fcfbc608
commit
944599f7c3
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user