summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2003-02-11 02:17:11 +0000
committerache <ache@FreeBSD.org>2003-02-11 02:17:11 +0000
commit76e83c6399fe26553ef9e857d466eac2c9ddb63b (patch)
tree67116bfad594aeb18a32d3912b5f63fc049847b1 /usr.sbin/pw
parentebb7bc433441055de657c0a26aa5406fd6d38047 (diff)
downloadFreeBSD-src-76e83c6399fe26553ef9e857d466eac2c9ddb63b.zip
FreeBSD-src-76e83c6399fe26553ef9e857d466eac2c9ddb63b.tar.gz
There is no sense to use random random() and arc4random() in the same program.
Switch to arc4random() completely.
Diffstat (limited to 'usr.sbin/pw')
-rw-r--r--usr.sbin/pw/pw_user.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index a2d5e78..a001e3e 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/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);
}
OpenPOWER on IntegriCloud