mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
There is no sense to use random random() and arc4random() in the same program.
Switch to arc4random() completely.
This commit is contained in:
parent
0f77478694
commit
c6c9094f0c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=110667
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user