(__setstate_r): Allow call with same state array as currently used.

This commit is contained in:
Ulrich Drepper 1998-09-10 17:07:14 +00:00
parent a9a1b00101
commit 9a4fe38ed6

View File

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