There is no sense to use random random() and arc4random() in the same program.

Switch to arc4random() completely.
This commit is contained in:
Andrey A. Chernov 2003-02-11 02:17:11 +00:00
parent 0f77478694
commit c6c9094f0c

View File

@ -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);
}