diff options
Diffstat (limited to 'src/lib/libc/stdlib/rand.c')
| -rw-r--r-- | src/lib/libc/stdlib/rand.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/rand.c b/src/lib/libc/stdlib/rand.c index 797d3b2848..838c98a9fd 100644 --- a/src/lib/libc/stdlib/rand.c +++ b/src/lib/libc/stdlib/rand.c | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | #if defined(LIBC_SCCS) && !defined(lint) | 34 | #if defined(LIBC_SCCS) && !defined(lint) |
| 35 | static char *rcsid = "$OpenBSD: rand.c,v 1.4 1998/11/22 07:41:04 deraadt Exp $"; | 35 | static char *rcsid = "$OpenBSD: rand.c,v 1.5 1998/12/07 16:44:41 millert Exp $"; |
| 36 | #endif /* LIBC_SCCS and not lint */ | 36 | #endif /* LIBC_SCCS and not lint */ |
| 37 | 37 | ||
| 38 | #include <sys/types.h> | 38 | #include <sys/types.h> |
| @@ -45,7 +45,7 @@ rand_r(seed) | |||
| 45 | u_int *seed; | 45 | u_int *seed; |
| 46 | { | 46 | { |
| 47 | *seed = *seed * 1103515245 + 12345; | 47 | *seed = *seed * 1103515245 + 12345; |
| 48 | return (u_int)(*seed / 65536) % ((u_int)RAND_MAX + 1); | 48 | return (u_int)(*seed) % ((u_int)RAND_MAX + 1); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | int | 51 | int |
