summaryrefslogtreecommitdiff
path: root/games/hangman/setup.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
commited884b9fa4509c09f0f7ab71efe57a4e83a2e055 (patch)
treeef9d859a0754785b42ea5cacb27aff54b5000315 /games/hangman/setup.c
parentf4fc9566a4d35c0cc2bf8c7f1136287d8eec8c44 (diff)
tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
Diffstat (limited to 'games/hangman/setup.c')
-rw-r--r--games/hangman/setup.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/games/hangman/setup.c b/games/hangman/setup.c
index 73c835f9551..03730d4c02b 100644
--- a/games/hangman/setup.c
+++ b/games/hangman/setup.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: setup.c,v 1.2 1998/08/19 07:40:45 pjanzen Exp $ */
/* $NetBSD: setup.c,v 1.3 1995/03/23 08:32:59 cgd Exp $ */
/*-
@@ -37,16 +38,18 @@
#if 0
static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: setup.c,v 1.3 1995/03/23 08:32:59 cgd Exp $";
+static char rcsid[] = "$OpenBSD: setup.c,v 1.2 1998/08/19 07:40:45 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "hangman.h"
+#include <err.h>
+#include "hangman.h"
/*
* setup:
* Set up the strings on the screen.
*/
+void
setup()
{
register char **sp;
@@ -67,11 +70,10 @@ setup()
addstr(*sp);
}
- srand(time(NULL) + getpid());
+ srandom(time(NULL) + getpid());
if ((Dict = fopen(_PATH_DICT, "r")) == NULL) {
- perror(_PATH_DICT);
endwin();
- exit(1);
+ err(1, "fopen %s", _PATH_DICT);
}
fstat(fileno(Dict), &sbuf);
Dict_size = sbuf.st_size;