aboutsummaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>1997-09-24 22:40:45 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>1997-09-24 22:40:45 +0000
commit6e429392aca88a6b755e793374c69ab00a7a3f84 (patch)
tree0f42ce19d1be958f8c64d500dcc886652a0fdaa2 /games
parent7df134f1fd30971f7b121288301e126b3bf82cf1 (diff)
Notes
Diffstat (limited to 'games')
-rw-r--r--games/battlestar/battlestar.c2
-rw-r--r--games/battlestar/externs.h3
-rw-r--r--games/battlestar/init.c2
3 files changed, 4 insertions, 3 deletions
diff --git a/games/battlestar/battlestar.c b/games/battlestar/battlestar.c
index c03b4d587c33..2499ff360169 100644
--- a/games/battlestar/battlestar.c
+++ b/games/battlestar/battlestar.c
@@ -91,6 +91,6 @@ run:
case 0:
goto start;
default:
- exit();
+ exit(0);
}
}
diff --git a/games/battlestar/externs.h b/games/battlestar/externs.h
index d6ff2c9710fc..692f267ec2e8 100644
--- a/games/battlestar/externs.h
+++ b/games/battlestar/externs.h
@@ -37,11 +37,12 @@
#include <sys/param.h>
#include <sys/signal.h>
#include <stdio.h>
+#include <stdlib.h>
#define BITS (8)
#define OUTSIDE (position > 68 && position < 246 && position != 218)
-#define rnd(x) (rand() % (x))
+#define rnd(x) (random() % (x))
#define max(a,b) ((a) < (b) ? (b) : (a))
#define testbit(array, index) (array[index/BITS] & (1 << (index % BITS)))
#ifndef setbit
diff --git a/games/battlestar/init.c b/games/battlestar/init.c
index 6d3a2ed917f2..e4aa3d866394 100644
--- a/games/battlestar/init.c
+++ b/games/battlestar/init.c
@@ -48,7 +48,7 @@ initialize(startup)
puts("Version 4.2, fall 1984.");
puts("First Adventure game written by His Lordship, the honorable");
puts("Admiral D.W. Riggle\n");
- srand(getpid());
+ srandomdev();
getutmp(uname);
if (startup)
location = dayfile;