summary refs log tree commit diff
path: root/stdlib/random_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/random_r.c')
-rw-r--r--stdlib/random_r.c4
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.  */