]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - hangman/setup.c
Update pom to the third edition of Duffett-Smith's book, and clean it
[bsdgames-darwin.git] / hangman / setup.c
index 0ddb260212fa20b7f1628de5efa7bc486b0843dc..81a97339ee19e9be5633cd0ccc037a840af2b26e 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: setup.c,v 1.4 1997/10/11 01:16:42 lukem Exp $  */
+/*     $NetBSD: setup.c,v 1.7 1999/09/09 17:30:20 jsm Exp $    */
 
 /*-
  * Copyright (c) 1983, 1993
 #if 0
 static char sccsid[] = "@(#)setup.c    8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: setup.c,v 1.4 1997/10/11 01:16:42 lukem Exp $");
+__RCSID("$NetBSD: setup.c,v 1.7 1999/09/09 17:30:20 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
+#include       <err.h>
+#include       <time.h>
 #include       "hangman.h"
 
 /*
@@ -51,7 +53,7 @@ __RCSID("$NetBSD: setup.c,v 1.4 1997/10/11 01:16:42 lukem Exp $");
 void
 setup()
 {
-       char **sp;
+       const char *const *sp;
        static struct stat sbuf;
 
        noecho();
@@ -71,9 +73,8 @@ setup()
 
        srand(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;