mirror of
git://sourceware.org/git/glibc.git
synced 2025-04-06 14:10:30 +08:00
(__setstate_r): Allow call with same state array as currently used.
This commit is contained in:
parent
a9a1b00101
commit
9a4fe38ed6
@ -243,8 +243,8 @@ __setstate_r (arg_state, buf)
|
||||
struct random_data *buf;
|
||||
{
|
||||
int32_t *new_state = (int32_t *) arg_state;
|
||||
int type = new_state[0] % MAX_TYPES;
|
||||
int rear = new_state[0] / MAX_TYPES;
|
||||
int type;
|
||||
int rear;
|
||||
|
||||
if (buf == NULL)
|
||||
return -1;
|
||||
@ -254,6 +254,9 @@ __setstate_r (arg_state, buf)
|
||||
else
|
||||
buf->state[-1] = (MAX_TYPES * (buf->rptr - buf->state)) + buf->rand_type;
|
||||
|
||||
type = new_state[0] % MAX_TYPES;
|
||||
rear = new_state[0] / MAX_TYPES;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user