about summary refs log tree commit diff
path: root/stdlib/random_r.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-21 23:31:38 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-21 23:31:38 +0000
commit7ca404adab483820ed7d43e961fef91d2e978f90 (patch)
treeded80da1a4c787630f73d6668daeec69f2fbca04 /stdlib/random_r.c
parent63336471f0e705e7259c9ecb0f9b473890ff5ffc (diff)
downloadglibc-7ca404adab483820ed7d43e961fef91d2e978f90.tar.gz
glibc-7ca404adab483820ed7d43e961fef91d2e978f90.tar.xz
glibc-7ca404adab483820ed7d43e961fef91d2e978f90.zip
Update.
	* stdlib/random_r.c (__setstate_r): Correct offset when computing
	new rptr and fptr.  Reported by Michael Fischer <fischer@cs.yale.edu>.

	* posix/regex.h: Add macro definitions to allow compiling outside
	glibc.
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.  */