diff options
Diffstat (limited to 'stdlib')
-rw-r--r-- | stdlib/random_r.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/stdlib/random_r.c b/stdlib/random_r.c index 27573b3b05..1d9e56f19b 100644 --- a/stdlib/random_r.c +++ b/stdlib/random_r.c @@ -295,8 +295,8 @@ __setstate_r (arg_state, buf) if (type != TYPE_0) { int rear = new_state[0] / MAX_TYPES; - buf->rptr = &new_state[rear]; - buf->fptr = &new_state[(rear + separation) % degree]; + buf->rptr = &new_state[1 + rear]; + buf->fptr = &new_state[1 + (rear + separation) % degree]; } buf->state = &new_state[1]; /* Set end_ptr too. */ |