aboutsummaryrefslogtreecommitdiff
path: root/randnum.c
diff options
context:
space:
mode:
authorPhilipp Klaus <philipp.klaus@gmail.com>2011-06-21 17:12:21 +0200
committerPhilipp Klaus <philipp.klaus@gmail.com>2011-06-21 17:12:21 +0200
commita067bd488fb1ad0ce4818c6601031554397c1d80 (patch)
tree7abf7fae76c0e77e17abaa83a2ca01030824661b /randnum.c
parent468a1f0c5bd165b6d0647b184885eb2040d7ddf4 (diff)
downloadpwgen-a067bd488fb1ad0ce4818c6601031554397c1d80.zip
automatic commit for pwgen-2.03
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));