aboutsummaryrefslogtreecommitdiff
path: root/randnum.c
diff options
context:
space:
mode:
Diffstat (limited to 'randnum.c')
-rw-r--r--randnum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/randnum.c b/randnum.c
index 6afa191..8d88e2d 100644
--- a/randnum.c
+++ b/randnum.c
@@ -47,7 +47,7 @@ static int get_random_fd(void)
#ifdef HAVE_DRAND48
drand48();
#else
- rand();
+ random();
#endif
return fd;
}
@@ -84,7 +84,7 @@ int pw_random_number(int max_num)
/* OK, we weren't able to use /dev/random, fall back to rand/rand48 */
-#ifdef RAND48
+#ifdef HAVE_DRAND48
return ((int) ((drand48() * max_num)));
#else
return ((int) (random() / ((float) RAND_MAX) * max_num));