aboutsummaryrefslogtreecommitdiff
path: root/games/trek/ranf.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/trek/ranf.c')
-rw-r--r--games/trek/ranf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/games/trek/ranf.c b/games/trek/ranf.c
index 7e58651a264a..b6cdeae5aab6 100644
--- a/games/trek/ranf.c
+++ b/games/trek/ranf.c
@@ -36,22 +36,20 @@ static char sccsid[] = "@(#)ranf.c 8.1 (Berkeley) 5/31/93";
#endif /* not lint */
# include <stdio.h>
+# include <stdlib.h>
ranf(max)
int max;
{
- register int t;
-
if (max <= 0)
return (0);
- t = rand() >> 5;
- return (t % max);
+ return (random() % max);
}
double franf()
{
double t;
- t = rand() & 077777;
+ t = random() & 077777;
return (t / 32767.0);
}