diff options
| author | Philipp Klaus <philipp.klaus@gmail.com> | 2011-06-21 17:12:21 +0200 |
|---|---|---|
| committer | Philipp Klaus <philipp.klaus@gmail.com> | 2011-06-21 17:12:21 +0200 |
| commit | 1832804a4c6771ff86fba6064a6fb575524b64ef (patch) | |
| tree | b931fdc1bb0692e5a3d145ceebc982e4d5d85d0f /randnum.c | |
| parent | a067bd488fb1ad0ce4818c6601031554397c1d80 (diff) | |
| download | pwgen-1832804a4c6771ff86fba6064a6fb575524b64ef.zip | |
automatic commit for pwgen-2.04
Diffstat (limited to 'randnum.c')
| -rw-r--r-- | randnum.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; |