diff options
Diffstat (limited to 'games/adventure')
-rw-r--r-- | games/adventure/main.c | 3 | ||||
-rw-r--r-- | games/adventure/wizard.c | 10 |
2 files changed, 6 insertions, 7 deletions
diff --git a/games/adventure/main.c b/games/adventure/main.c index 54f60eedebc..56318222bc2 100644 --- a/games/adventure/main.c +++ b/games/adventure/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.19 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.20 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: main.c,v 1.5 1996/05/21 21:53:09 mrg Exp $ */ /*- @@ -37,7 +37,6 @@ /* Re-coding of advent in C: main program */ -#include <sys/file.h> #include <err.h> #include <signal.h> #include <stdio.h> diff --git a/games/adventure/wizard.c b/games/adventure/wizard.c index 55690443991..5255115834e 100644 --- a/games/adventure/wizard.c +++ b/games/adventure/wizard.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wizard.c,v 1.15 2013/08/22 04:43:41 guenther Exp $ */ +/* $OpenBSD: wizard.c,v 1.16 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: wizard.c,v 1.3 1995/04/24 12:21:41 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ /* Re-coding of advent in C: privileged operations */ -#include <sys/param.h> +#include <limits.h> #include <stdio.h> #include <string.h> #include <stdlib.h> @@ -117,15 +117,15 @@ ciao(void) { int ch; char *c; - char fname[MAXPATHLEN]; + char fname[PATH_MAX]; printf("What would you like to call the saved version?\n"); - for (c = fname; c - fname < MAXPATHLEN; c++) { + for (c = fname; c - fname < sizeof(fname); c++) { if ((ch = getchar()) == '\n' || ch == EOF) break; *c = ch; } - if (c - fname == MAXPATHLEN) { + if (c - fname == sizeof(fname)) { c--; FLUSHLINE; } |