summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/rand.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1998-12-07 16:44:41 +0000
committermillert <millert@openbsd.org>1998-12-07 16:44:41 +0000
commitf004b32ba66527e546ad755ede735cb1626be728 (patch)
treecbe28be6d31f01da646a1686b161deac864ed4ba /lib/libc/stdlib/rand.c
parentFix a minor 64 bit constant synth. bug (diff)
downloadwireguard-openbsd-f004b32ba66527e546ad755ede735cb1626be728.tar.xz
wireguard-openbsd-f004b32ba66527e546ad755ede735cb1626be728.zip
remove bogus divide, fixes pr #656
Diffstat (limited to 'lib/libc/stdlib/rand.c')
-rw-r--r--lib/libc/stdlib/rand.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdlib/rand.c b/lib/libc/stdlib/rand.c
index 797d3b2848b..838c98a9fd0 100644
--- a/lib/libc/stdlib/rand.c
+++ b/lib/libc/stdlib/rand.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: rand.c,v 1.4 1998/11/22 07:41:04 deraadt Exp $";
+static char *rcsid = "$OpenBSD: rand.c,v 1.5 1998/12/07 16:44:41 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -45,7 +45,7 @@ rand_r(seed)
u_int *seed;
{
*seed = *seed * 1103515245 + 12345;
- return (u_int)(*seed / 65536) % ((u_int)RAND_MAX + 1);
+ return (u_int)(*seed) % ((u_int)RAND_MAX + 1);
}
int