summaryrefslogtreecommitdiffstats
path: root/monop/roll.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2008-02-20 04:48:10 +0000
committerdholland <dholland@NetBSD.org>2008-02-20 04:48:10 +0000
commit413a596f439ac842277d61847a166f6c8ea6f497 (patch)
treea9854443f3fb048cc97d37b27fcf2565d03a7cc5 /monop/roll.c
parentadd44e03d1bf488b8342d844a181698d900b3ee1 (diff)
downloadbsdgames-darwin-413a596f439ac842277d61847a166f6c8ea6f497.tar.gz
bsdgames-darwin-413a596f439ac842277d61847a166f6c8ea6f497.tar.zst
bsdgames-darwin-413a596f439ac842277d61847a166f6c8ea6f497.zip
Use random() rather than rand(). Suggested by diffing against OpenBSD.
Diffstat (limited to 'monop/roll.c')
-rw-r--r--monop/roll.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/monop/roll.c b/monop/roll.c
index 07395fa9..b3e5a9d7 100644
--- a/monop/roll.c
+++ b/monop/roll.c
@@ -1,4 +1,4 @@
-/* $NetBSD: roll.c,v 1.9 2003/08/07 09:37:29 agc Exp $ */
+/* $NetBSD: roll.c,v 1.10 2008/02/20 04:48:10 dholland Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)roll.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: roll.c,v 1.9 2003/08/07 09:37:29 agc Exp $");
+__RCSID("$NetBSD: roll.c,v 1.10 2008/02/20 04:48:10 dholland Exp $");
#endif
#endif /* not lint */
@@ -74,7 +74,7 @@ roll(ndie, nsides)
num_sides = nsides;
tot = 0;
while (ndie--)
- tot += (r = rand()) * (num_sides / RAND_MAX) + 1;
+ tot += (r = random()) * (num_sides / RAND_MAX) + 1;
return tot;
}
#endif