Use arc4random_uniform(3)

This commit is contained in:
Andrey A. Chernov 2008-08-07 20:05:51 +00:00
parent 808463a45f
commit dc5fe8845b

View File

@ -447,8 +447,6 @@ void randomize()
off_t tmp;
off_t *sp;
srandomdev();
Tbl.str_flags |= STR_RANDOM;
cnt = Tbl.str_numstr;
@ -457,7 +455,7 @@ void randomize()
*/
for (sp = Seekpts; cnt > 0; cnt--, sp++) {
i = random() % cnt;
i = arc4random_uniform(cnt);
tmp = sp[0];
sp[0] = sp[i];
sp[i] = tmp;