diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-08-29 20:22:23 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2013-08-29 20:22:23 +0000 |
commit | 8ce81dbb9ce96aff37591175c4be0778150c387c (patch) | |
tree | fe2cf8a0e8381920812ba877a940668255c15104 /games/worms | |
parent | 514acfbf4d29506078ac09ba5d85f12a80634c1f (diff) |
replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@
Diffstat (limited to 'games/worms')
-rw-r--r-- | games/worms/worms.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/games/worms/worms.c b/games/worms/worms.c index 30b3bd10758..ee78203b0f0 100644 --- a/games/worms/worms.c +++ b/games/worms/worms.c @@ -1,4 +1,4 @@ -/* $OpenBSD: worms.c,v 1.20 2011/04/25 13:30:07 millert Exp $ */ +/* $OpenBSD: worms.c,v 1.21 2013/08/29 20:22:21 naddy Exp $ */ /* * Copyright (c) 1980, 1993 @@ -226,7 +226,6 @@ main(int argc, char *argv[]) sleeptime.tv_nsec = delay * 500000; timespecadd(&sleeptime, &sleeptime, &sleeptime); - srandomdev(); if (!(worm = calloc((size_t)number, sizeof(struct worm)))) nomem(); initscr(); @@ -319,7 +318,7 @@ main(int argc, char *argv[]) break; default: w->orientation = - op->opts[(int)random() % op->nopts]; + op->opts[arc4random_uniform(op->nopts)]; } mvaddch(y += yinc[w->orientation], x += xinc[w->orientation], |