diff options
author | Andrey A. Chernov <ache@FreeBSD.org> | 2003-02-11 02:17:11 +0000 |
---|---|---|
committer | Andrey A. Chernov <ache@FreeBSD.org> | 2003-02-11 02:17:11 +0000 |
commit | 491158b1eeb49352890a530b064a53f8fcb74491 (patch) | |
tree | 31173ad3fbe3f33a75077ed847b6c7732686eaff | |
parent | 810451ea5c7d0363d6a05d1b97f36db289242320 (diff) | |
download | pw-darwin-491158b1eeb49352890a530b064a53f8fcb74491.tar.gz pw-darwin-491158b1eeb49352890a530b064a53f8fcb74491.tar.zst pw-darwin-491158b1eeb49352890a530b064a53f8fcb74491.zip |
There is no sense to use random random() and arc4random() in the same program.
Switch to arc4random() completely.
-rw-r--r-- | pw/pw_user.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index a2d5e78..a001e3e 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -1058,9 +1058,8 @@ pw_getrand(u_char *buf, int len) { int i; - srandomdev(); for (i = 0; i < len; i++) { - unsigned long val = random(); + unsigned long val = arc4random(); /* Use all bits in the random value */ buf[i]=(u_char)((val >> 24) ^ (val >> 16) ^ (val >> 8) ^ val); } |