summaryrefslogtreecommitdiff
path: root/games/worms
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2013-08-29 20:22:23 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2013-08-29 20:22:23 +0000
commit8ce81dbb9ce96aff37591175c4be0778150c387c (patch)
treefe2cf8a0e8381920812ba877a940668255c15104 /games/worms
parent514acfbf4d29506078ac09ba5d85f12a80634c1f (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.c5
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],