summaryrefslogtreecommitdiff
path: root/games/bs
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/bs
parent514acfbf4d29506078ac09ba5d85f12a80634c1f (diff)
replace srandomdev()+random() with the arc4random*() family
tweaks and ok millert@, ok deraadt@
Diffstat (limited to 'games/bs')
-rw-r--r--games/bs/bs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/games/bs/bs.c b/games/bs/bs.c
index dc7a83b50b0..6a6a605c5b5 100644
--- a/games/bs/bs.c
+++ b/games/bs/bs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs.c,v 1.23 2009/11/14 02:20:43 guenther Exp $ */
+/* $OpenBSD: bs.c,v 1.24 2013/08/29 20:22:11 naddy Exp $ */
/*
* Copyright (c) 1986, Bruce Holloway
* All rights reserved.
@@ -39,8 +39,6 @@
* v2.2 with bugfixes and strategical improvements, March 1998.
*/
-/* #define _POSIX_SOURCE */ /* ( random() ) */
-
#include <sys/param.h>
#include <sys/types.h>
#include <curses.h>
@@ -235,8 +233,6 @@ static void intro(void)
{
char *tmpname;
- srandomdev(); /* Kick the random number generator */
-
(void) signal(SIGINT,uninitgame);
(void) signal(SIGINT,uninitgame);
if(signal(SIGQUIT,SIG_IGN) != SIG_IGN)
@@ -344,7 +340,7 @@ static void placeship(int b, ship_t *ss, int vis)
static int rnd(int n)
{
- return(((random() & 0x7FFF) % n));
+ return(arc4random_uniform(n));
}
static void randomplace(int b, ship_t *ss)