summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpjanzen <pjanzen@openbsd.org>2002-08-09 08:42:30 +0000
committerpjanzen <pjanzen@openbsd.org>2002-08-09 08:42:30 +0000
commitcbddbf5976261a9192595ad38fa21d723b277b9a (patch)
treee8e9a7135be33739ab6ccb32975dbee6116b84ab
parentBug fix in random placement code from Erik Sigra. (diff)
downloadwireguard-openbsd-cbddbf5976261a9192595ad38fa21d723b277b9a.tar.xz
wireguard-openbsd-cbddbf5976261a9192595ad38fa21d723b277b9a.zip
Fix an error in the CPU random fire routine that could cause a segfault.
-rw-r--r--games/bs/bs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/games/bs/bs.c b/games/bs/bs.c
index e6529bee34b..30cee3aa2a2 100644
--- a/games/bs/bs.c
+++ b/games/bs/bs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bs.c,v 1.15 2002/08/09 08:36:33 pjanzen Exp $ */
+/* $OpenBSD: bs.c,v 1.16 2002/08/09 08:42:30 pjanzen Exp $ */
/*
* bs.c - original author: Bruce Holloway
* salvo option by: Chuck A DeGaul
@@ -11,7 +11,7 @@
*/
#ifndef lint
-static const char rcsid[] = "$OpenBSD: bs.c,v 1.15 2002/08/09 08:36:33 pjanzen Exp $";
+static const char rcsid[] = "$OpenBSD: bs.c,v 1.16 2002/08/09 08:42:30 pjanzen Exp $";
#endif
/* #define _POSIX_SOURCE */ /* ( random() ) */
@@ -977,6 +977,7 @@ static void randomfire(int *px, int *py)
else if (srchstep > cpulongest)
{
--srchstep;
+ randomfire(px, py);
}
else
{