summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/rand.c
diff options
context:
space:
mode:
authorpat <pat@openbsd.org>2005-03-30 18:51:49 +0000
committerpat <pat@openbsd.org>2005-03-30 18:51:49 +0000
commitd8bc04e435448c902a8c004581e7486635bbff02 (patch)
treeeb84adde243775bdc6375d84958a66b4eb36c02c /lib/libc/stdlib/rand.c
parentMove sasyncd(8), for IPsec SA synchronization, in-tree. Work in progress. (diff)
downloadwireguard-openbsd-d8bc04e435448c902a8c004581e7486635bbff02.tar.xz
wireguard-openbsd-d8bc04e435448c902a8c004581e7486635bbff02.zip
ansi + de-register
ok otto deraadt
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;
}