Skip to content

Commit

Permalink
Use arc4random_uniform(3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey A. Chernov authored and Andrey A. Chernov committed Aug 7, 2008
1 parent 808463a commit dc5fe88
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions games/fortune/strfile/strfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,8 +447,6 @@ void randomize()
off_t tmp;
off_t *sp;

srandomdev();

Tbl.str_flags |= STR_RANDOM;
cnt = Tbl.str_numstr;

Expand All @@ -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;
Expand Down

0 comments on commit dc5fe88

Please sign in to comment.