summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/rand.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/rand.c')
-rw-r--r--lib/libc/stdlib/rand.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index d58d040ad54..6b27ad46d35 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rand.c,v 1.7 2003/06/02 20:18:38 millert Exp $";
+static char *rcsid = "$OpenBSD: rand.c,v 1.8 2005/03/30 18:51:49 pat Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -37,25 +37,20 @@ static char *rcsid = "$OpenBSD: rand.c,v 1.7 2003/06/02 20:18:38 millert Exp $";
static u_int next = 1;
int
-rand_r(seed)
-u_int *seed;
+rand_r(u_int *seed)
{
-
*seed = *seed * 1103515245 + 12345;
return (*seed % ((u_int)RAND_MAX + 1));
}
int
-rand()
+rand(void)
{
-
return (rand_r(&next));
}
void
-srand(seed)
-u_int seed;
+srand(u_int seed)
{
-
next = seed;
}