summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2003-02-11 02:17:11 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2003-02-11 02:17:11 +0000
commit0bc7ade67c5c379f22d8791f741a16489a673dd0 (patch)
tree927bec0ec4798f94e4eada8e8486c2ce81e28d6c
parent49b2fe91cdbf735a6309ac7fb924dd29ee00373a (diff)
downloadpw-darwin-0bc7ade67c5c379f22d8791f741a16489a673dd0.tar.gz
pw-darwin-0bc7ade67c5c379f22d8791f741a16489a673dd0.tar.zst
pw-darwin-0bc7ade67c5c379f22d8791f741a16489a673dd0.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.c3
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);
}