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
commit1832804a4c6771ff86fba6064a6fb575524b64ef (patch)
treeb931fdc1bb0692e5a3d145ceebc982e4d5d85d0f /randnum.c
parenta067bd488fb1ad0ce4818c6601031554397c1d80 (diff)
downloadpwgen-1832804a4c6771ff86fba6064a6fb575524b64ef.zip
automatic commit for pwgen-2.04
Diffstat (limited to 'randnum.c')
-rw-r--r--randnum.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/randnum.c b/randnum.c
index 8d88e2d..036e092 100644
--- a/randnum.c
+++ b/randnum.c
@@ -21,8 +21,10 @@
extern double drand48(void);
#endif
+static int get_random_fd(void);
+
/* Borrowed/adapted from e2fsprogs's UUID generation code */
-static int get_random_fd(void)
+static int get_random_fd()
{
struct timeval tv;
static int fd = -2;
@@ -56,7 +58,8 @@ static int get_random_fd(void)
* Generate a random number n, where 0 <= n < max_num, using
* /dev/urandom if possible.
*/
-int pw_random_number(int max_num)
+int pw_random_number(max_num)
+ int max_num;
{
int i, fd = get_random_fd();
int lose_counter = 0, nbytes=4;