diff options
31 files changed, 82 insertions, 96 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; } diff --git a/games/atc/include.h b/games/atc/include.h index 76870387254..581a1198960 100644 --- a/games/atc/include.h +++ b/games/atc/include.h @@ -1,4 +1,4 @@ -/* $OpenBSD: include.h,v 1.6 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: include.h,v 1.7 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: include.h,v 1.5 1995/04/27 21:22:23 mycroft Exp $ */ /*- @@ -45,8 +45,6 @@ */ #include <sys/types.h> -#include <sys/file.h> -#include <sys/param.h> #include <sys/stat.h> #include <sys/time.h> #include <sys/utsname.h> @@ -57,6 +55,7 @@ #include <err.h> #include <errno.h> #include <fcntl.h> +#include <limits.h> #include <math.h> #include <pwd.h> #include <signal.h> diff --git a/games/atc/struct.h b/games/atc/struct.h index 5b834c9e41f..63cfe4b2701 100644 --- a/games/atc/struct.h +++ b/games/atc/struct.h @@ -1,4 +1,4 @@ -/* $OpenBSD: struct.h,v 1.4 2003/06/03 03:01:38 millert Exp $ */ +/* $OpenBSD: struct.h,v 1.5 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: struct.h,v 1.3 1995/03/21 15:04:31 cgd Exp $ */ /*- @@ -96,7 +96,7 @@ typedef struct { } LIST; typedef struct { - char name[MAXLOGNAME]; + char name[LOGIN_NAME_MAX]; char game[256]; int planes; int time; diff --git a/games/backgammon/common_source/save.c b/games/backgammon/common_source/save.c index a56b22db6da..9918e1e0f43 100644 --- a/games/backgammon/common_source/save.c +++ b/games/backgammon/common_source/save.c @@ -1,4 +1,4 @@ -/* $OpenBSD: save.c,v 1.10 2009/10/27 23:59:23 deraadt Exp $ */ +/* $OpenBSD: save.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */ /* * Copyright (c) 1980, 1993 @@ -29,8 +29,8 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <ctype.h> +#include <limits.h> #include <errno.h> #include "back.h" @@ -51,7 +51,7 @@ save(n) { int fdesc; char *fs; - char fname[MAXPATHLEN]; + char fname[PATH_MAX]; int r, c, i; if (n) { @@ -75,7 +75,7 @@ save(n) beep(); continue; } - if (fs - fname < MAXPATHLEN - 1) { + if (fs - fname < sizeof(fname) - 1) { if (isascii(i)) { *fs = i; addch(*fs++); diff --git a/games/battlestar/extern.h b/games/battlestar/extern.h index edeed086215..0f62f3dd4b1 100644 --- a/games/battlestar/extern.h +++ b/games/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $OpenBSD: extern.h,v 1.15 2013/08/29 20:22:10 naddy Exp $ */ +/* $OpenBSD: extern.h,v 1.16 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: extern.h,v 1.5 1995/04/24 12:22:18 cgd Exp $ */ /* @@ -32,7 +32,6 @@ * @(#)extern.h 8.1 (Berkeley) 5/31/93 */ -#include <sys/param.h> #include <sys/time.h> #include <ctype.h> diff --git a/games/boggle/boggle/timer.c b/games/boggle/boggle/timer.c index a52ed49e595..529df89772c 100644 --- a/games/boggle/boggle/timer.c +++ b/games/boggle/boggle/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.11 2013/09/12 23:06:43 krw Exp $ */ +/* $OpenBSD: timer.c,v 1.12 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: timer.c,v 1.3 1995/04/24 12:22:45 cgd Exp $ */ /*- @@ -33,7 +33,6 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <sys/time.h> #include <curses.h> diff --git a/games/bs/bs.c b/games/bs/bs.c index db2edfed6c7..c4fa9c8a630 100644 --- a/games/bs/bs.c +++ b/games/bs/bs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bs.c,v 1.25 2014/07/12 08:29:56 tedu Exp $ */ +/* $OpenBSD: bs.c,v 1.26 2014/11/16 04:49:48 guenther Exp $ */ /* * Copyright (c) 1986, Bruce Holloway * All rights reserved. @@ -39,11 +39,11 @@ * v2.2 with bugfixes and strategical improvements, March 1998. */ -#include <sys/param.h> #include <sys/types.h> #include <curses.h> #include <ctype.h> #include <err.h> +#include <limits.h> #include <signal.h> #include <stdlib.h> #include <string.h> @@ -115,7 +115,7 @@ static char sub[] = "Submarine"; static char destroy[] = "Destroyer"; static char ptboat[] = "PT Boat"; -static char name[MAXLOGNAME]; +static char name[LOGIN_NAME_MAX]; static char dftname[] = "stranger"; /* direction constants */ diff --git a/games/fortune/fortune/fortune.c b/games/fortune/fortune/fortune.c index 0fa6bcb890c..11287d80ef8 100644 --- a/games/fortune/fortune/fortune.c +++ b/games/fortune/fortune/fortune.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fortune.c,v 1.31 2014/01/11 06:28:46 guenther Exp $ */ +/* $OpenBSD: fortune.c,v 1.32 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: fortune.c,v 1.8 1995/03/23 08:28:40 cgd Exp $ */ /*- @@ -33,7 +33,6 @@ * SUCH DAMAGE. */ -# include <sys/param.h> # include <sys/stat.h> # include <dirent.h> diff --git a/games/fortune/strfile/strfile.c b/games/fortune/strfile/strfile.c index 1dc5f4546c0..06ab3addc1b 100644 --- a/games/fortune/strfile/strfile.c +++ b/games/fortune/strfile/strfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strfile.c,v 1.20 2014/10/11 04:00:56 doug Exp $ */ +/* $OpenBSD: strfile.c,v 1.21 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: strfile.c,v 1.4 1995/04/24 12:23:09 cgd Exp $ */ /*- @@ -33,9 +33,9 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <ctype.h> #include <err.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -89,7 +89,7 @@ typedef struct { } STR; char *Infile = NULL, /* input file name */ - Outfile[MAXPATHLEN] = "", /* output file name */ + Outfile[PATH_MAX] = "", /* output file name */ Delimch = '%'; /* delimiting character */ int Sflag = FALSE; /* silent run flag */ @@ -291,7 +291,7 @@ getargs(int argc, char *argv[]) } if (*Outfile == '\0') { (void) strlcpy(Outfile, Infile, sizeof(Outfile)); - if (strlcat(Outfile, ".dat", sizeof(Outfile)) >= MAXPATHLEN) + if (strlcat(Outfile, ".dat", sizeof(Outfile)) >= sizeof(Outfile)) errx(1, "`%s': name too long", Infile); } } diff --git a/games/fortune/unstr/unstr.c b/games/fortune/unstr/unstr.c index c081ceb6209..43bcb645a54 100644 --- a/games/fortune/unstr/unstr.c +++ b/games/fortune/unstr/unstr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: unstr.c,v 1.10 2009/10/27 23:59:24 deraadt Exp $ */ +/* $OpenBSD: unstr.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: unstr.c,v 1.3 1995/03/23 08:29:00 cgd Exp $ */ /*- @@ -46,15 +46,15 @@ * Ken Arnold Aug 13, 1978 */ -#include <sys/param.h> #include <ctype.h> #include <err.h> +#include <limits.h> #include <stdio.h> #include <string.h> #include "strfile.h" char *Infile, /* name of input file */ - Datafile[MAXPATHLEN], /* name of data file */ + Datafile[PATH_MAX], /* name of data file */ Delimch; /* delimiter character */ FILE *Inf, *Dataf; @@ -97,7 +97,7 @@ getargs(char *av[]) } Infile = *av; (void) strlcpy(Datafile, Infile, sizeof(Datafile)); - if (strlcat(Datafile, ".dat", sizeof(Datafile)) >= MAXPATHLEN) + if (strlcat(Datafile, ".dat", sizeof(Datafile)) >= sizeof(Datafile)) errx(1, "`%s': filename too long", Infile); } diff --git a/games/gomoku/main.c b/games/gomoku/main.c index bb646880e37..35413afeee9 100644 --- a/games/gomoku/main.c +++ b/games/gomoku/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.24 2013/08/29 20:22:13 naddy Exp $ */ +/* $OpenBSD: main.c,v 1.25 2014/11/16 04:49:48 guenther Exp $ */ /* * Copyright (c) 1994 * The Regents of the University of California. All rights reserved. @@ -31,9 +31,9 @@ * SUCH DAMAGE. */ -#include <sys/param.h> #include <curses.h> #include <err.h> +#include <limits.h> #include <signal.h> #include <stdlib.h> #include <string.h> @@ -64,7 +64,7 @@ int movelog[BSZ * BSZ]; /* log of all the moves */ int movenum; /* current move number */ char *plyr[2]; /* who's who */ -static char you[MAXLOGNAME]; /* username */ +static char you[LOGIN_NAME_MAX]; /* username */ int main(argc, argv) @@ -72,7 +72,7 @@ main(argc, argv) char **argv; { char buf[128]; - char fname[MAXPATHLEN]; + char fname[PATH_MAX]; int color = BLACK, curmove = 0, i, ch; int input[2]; static char *fmt[2] = { diff --git a/games/hack/hack.unix.c b/games/hack/hack.unix.c index 8017b810cb1..18502de172c 100644 --- a/games/hack/hack.unix.c +++ b/games/hack/hack.unix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hack.unix.c,v 1.14 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: hack.unix.c,v 1.15 2014/11/16 04:49:48 guenther Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -74,11 +74,11 @@ #include <sys/types.h> /* for time_t and stat */ #include <sys/stat.h> -#include <sys/param.h> #include <sys/time.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> @@ -156,7 +156,7 @@ void gethdate(char *name) { char *p, *np, *path; - char filename[MAXPATHLEN+1]; + char filename[PATH_MAX+1]; if (strchr(name, '/') != NULL || (p = getenv("PATH")) == NULL) p = ""; diff --git a/games/hunt/hunt/hunt.c b/games/hunt/hunt/hunt.c index 6aa5814355d..c073fb73469 100644 --- a/games/hunt/hunt/hunt.c +++ b/games/hunt/hunt/hunt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hunt.c,v 1.13 2008/03/17 09:17:56 sobrado Exp $ */ +/* $OpenBSD: hunt.c,v 1.14 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: hunt.c,v 1.8 1998/09/13 15:27:28 hubertf Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -45,8 +45,6 @@ #include <sys/time.h> #include <sys/types.h> #include <sys/socket.h> -#include <sys/ioctl.h> -#include <sys/sockio.h> #include <netinet/in.h> #include <net/if.h> diff --git a/games/hunt/hunt/playit.c b/games/hunt/hunt/playit.c index 5ab8e4df8c0..99c06aaa951 100644 --- a/games/hunt/hunt/playit.c +++ b/games/hunt/hunt/playit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: playit.c,v 1.8 2003/06/11 08:45:25 pjanzen Exp $ */ +/* $OpenBSD: playit.c,v 1.9 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -31,7 +31,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include <sys/file.h> #include <err.h> #include <errno.h> #include <ctype.h> diff --git a/games/mille/misc.c b/games/mille/misc.c index 80e5d111f2f..c4f14405221 100644 --- a/games/mille/misc.c +++ b/games/mille/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.10 2009/10/27 23:59:25 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: misc.c,v 1.4 1995/03/24 05:01:54 cgd Exp $ */ /* @@ -30,7 +30,6 @@ * SUCH DAMAGE. */ -#include <sys/file.h> #include <termios.h> #include <stdarg.h> diff --git a/games/mille/move.c b/games/mille/move.c index 9a406bb06be..de0e0dc3ffd 100644 --- a/games/mille/move.c +++ b/games/mille/move.c @@ -1,4 +1,4 @@ -/* $OpenBSD: move.c,v 1.12 2009/12/10 23:53:05 beck Exp $ */ +/* $OpenBSD: move.c,v 1.13 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: move.c,v 1.4 1995/03/24 05:01:57 cgd Exp $ */ /* @@ -30,11 +30,8 @@ * SUCH DAMAGE. */ -#ifdef DEBUG -#include <sys/param.h> -#endif - -#include <termios.h> +#include <limits.h> +#include <termios.h> #include "mille.h" /* @@ -417,7 +414,7 @@ getmove() #ifdef DEBUG case 'Z': /* Debug code */ if (!Debug && outf == NULL) { - char buf[MAXPATHLEN]; + char buf[PATH_MAX]; over: prompt(FILEPROMPT); leaveok(Board, FALSE); diff --git a/games/phantasia/include.h b/games/phantasia/include.h index f489818182f..cc69c342410 100644 --- a/games/phantasia/include.h +++ b/games/phantasia/include.h @@ -1,16 +1,15 @@ -/* $OpenBSD: include.h,v 1.4 2013/08/29 20:22:17 naddy Exp $ */ +/* $OpenBSD: include.h,v 1.5 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: include.h,v 1.3 1995/04/24 12:24:31 cgd Exp $ */ /* * include.h - includes all important files for Phantasia */ -#include <sys/param.h> - #include <ctype.h> #include <curses.h> #include <err.h> #include <errno.h> +#include <limits.h> #include <math.h> #include <setjmp.h> #include <signal.h> diff --git a/games/phantasia/main.c b/games/phantasia/main.c index 0b96d91d09d..03d432c8273 100644 --- a/games/phantasia/main.c +++ b/games/phantasia/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.16 2014/07/12 03:41:04 deraadt Exp $ */ +/* $OpenBSD: main.c,v 1.17 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: main.c,v 1.3 1995/04/24 12:24:37 cgd Exp $ */ /* @@ -29,6 +29,7 @@ */ #include <sys/types.h> +#include <limits.h> #include <pwd.h> #ifdef TERMIOS #include <termios.h> @@ -194,7 +195,7 @@ main(argc, argv) Timeout = TRUE; /* update some important player statistics */ - strlcpy(Player.p_login, Login, MAXLOGNAME); + strlcpy(Player.p_login, Login, LOGIN_NAME_MAX); time(&seconds); Player.p_lastused = localtime(&seconds)->tm_yday; Player.p_status = S_PLAYING; diff --git a/games/phantasia/phantstruct.h b/games/phantasia/phantstruct.h index 5ebf05274c1..5d8ca90b73d 100644 --- a/games/phantasia/phantstruct.h +++ b/games/phantasia/phantstruct.h @@ -1,4 +1,4 @@ -/* $OpenBSD: phantstruct.h,v 1.3 2001/02/04 02:51:25 pjanzen Exp $ */ +/* $OpenBSD: phantstruct.h,v 1.4 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: phantstruct.h,v 1.2 1995/03/24 04:00:11 cgd Exp $ */ /* @@ -60,7 +60,7 @@ struct player /* player statistics */ char p_name[SZ_NAME]; /* name */ char p_password[SZ_PASSWORD];/* password */ - char p_login[MAXLOGNAME]; /* login */ + char p_login[LOGIN_NAME_MAX];/* login */ }; struct monster /* monster stats */ @@ -97,7 +97,7 @@ struct scoreboard /* scoreboard entry */ double sb_level; /* level of player */ char sb_type[4]; /* character type of player */ char sb_name[SZ_NAME]; /* name of player */ - char sb_login[MAXLOGNAME]; /* login of player */ + char sb_login[LOGIN_NAME_MAX];/* login of player */ }; struct charstats /* character type statistics */ diff --git a/games/phantasia/setup.c b/games/phantasia/setup.c index 9ab9691eb68..d3cd785ba25 100644 --- a/games/phantasia/setup.c +++ b/games/phantasia/setup.c @@ -1,13 +1,13 @@ -/* $OpenBSD: setup.c,v 1.12 2013/08/29 20:22:17 naddy Exp $ */ +/* $OpenBSD: setup.c,v 1.13 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: setup.c,v 1.4 1995/04/24 12:24:41 cgd Exp $ */ /* * setup.c - set up all files for Phantasia */ -#include <sys/param.h> -#include <sys/stat.h> #include <sys/types.h> +#include <sys/stat.h> #include "include.h" +#include <limits.h> #include <fcntl.h> void Error(char *, char *); @@ -68,7 +68,7 @@ main(argc, argv) FILE *fp; /* for opening files */ struct stat fbuf; /* for getting files statistics */ int ch; - char path[MAXPATHLEN], *prefix; + char path[PATH_MAX], *prefix; while ((ch = getopt(argc, argv, "m:")) != -1) switch(ch) { diff --git a/games/robots/robots.h b/games/robots/robots.h index 52aa374df92..67bebb8edcb 100644 --- a/games/robots/robots.h +++ b/games/robots/robots.h @@ -1,4 +1,4 @@ -/* $OpenBSD: robots.h,v 1.7 2014/11/03 22:14:54 deraadt Exp $ */ +/* $OpenBSD: robots.h,v 1.8 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: robots.h,v 1.5 1995/04/24 12:24:54 cgd Exp $ */ /* @@ -32,7 +32,6 @@ * @(#)robots.h 8.1 (Berkeley) 5/31/93 */ -#include <sys/param.h> #include <sys/types.h> #include <sys/time.h> #include <ctype.h> @@ -40,6 +39,7 @@ #include <err.h> #include <errno.h> #include <fcntl.h> +#include <limits.h> #include <pwd.h> #include <signal.h> #include <string.h> @@ -85,7 +85,7 @@ typedef struct { typedef struct { uid_t s_uid; int s_score; - char s_name[MAXLOGNAME]; + char s_name[LOGIN_NAME_MAX]; } SCORE; typedef struct passwd PASSWD; diff --git a/games/robots/score.c b/games/robots/score.c index 2b9fae1532a..9b41adb7b49 100644 --- a/games/robots/score.c +++ b/games/robots/score.c @@ -1,4 +1,4 @@ -/* $OpenBSD: score.c,v 1.10 2009/10/27 23:59:26 deraadt Exp $ */ +/* $OpenBSD: score.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: score.c,v 1.3 1995/04/22 10:09:12 cgd Exp $ */ /* @@ -134,7 +134,7 @@ set_name(SCORE *scp) if ((pp = getpwuid(scp->s_uid)) == NULL) pp->pw_name = "???"; - strlcpy(scp->s_name, pp->pw_name, MAXLOGNAME); + strlcpy(scp->s_name, pp->pw_name, LOGIN_NAME_MAX); } /* diff --git a/games/sail/lo_main.c b/games/sail/lo_main.c index 097d3df0e26..ecf03242dea 100644 --- a/games/sail/lo_main.c +++ b/games/sail/lo_main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lo_main.c,v 1.7 2009/10/27 23:59:27 deraadt Exp $ */ +/* $OpenBSD: lo_main.c,v 1.8 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: lo_main.c,v 1.3 1995/04/22 10:36:59 cgd Exp $ */ /* @@ -35,8 +35,8 @@ * * -l force a long listing (print out real usernames) */ -#include <sys/param.h> #include <sys/types.h> +#include <limits.h> #include <pwd.h> #include <stdlib.h> #include "extern.h" @@ -52,7 +52,7 @@ int lo_main() { FILE *fp; - char sbuf[20+MAXLOGNAME]; + char sbuf[20+LOGIN_NAME_MAX]; int n = 0, people; struct passwd *pass; struct logs log; diff --git a/games/sail/misc.c b/games/sail/misc.c index 32a3915b381..bbf5353d74a 100644 --- a/games/sail/misc.c +++ b/games/sail/misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: misc.c,v 1.5 2009/10/27 23:59:27 deraadt Exp $ */ +/* $OpenBSD: misc.c,v 1.6 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: misc.c,v 1.3 1995/04/22 10:37:03 cgd Exp $ */ /* @@ -32,7 +32,6 @@ #include <fcntl.h> #include <stdlib.h> -#include <sys/file.h> #include <unistd.h> #include "extern.h" #include "pathnames.h" diff --git a/games/sail/pl_7.c b/games/sail/pl_7.c index 27890c681a1..4851a6d755a 100644 --- a/games/sail/pl_7.c +++ b/games/sail/pl_7.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pl_7.c,v 1.9 2009/10/27 23:59:27 deraadt Exp $ */ +/* $OpenBSD: pl_7.c,v 1.10 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: pl_7.c,v 1.6 1995/04/22 10:37:17 cgd Exp $ */ /* @@ -30,7 +30,6 @@ * SUCH DAMAGE. */ -#include <sys/ttydefaults.h> #include "player.h" #include <stdarg.h> #include <unistd.h> diff --git a/games/sail/sync.c b/games/sail/sync.c index 73b8d69eef5..806ed530200 100644 --- a/games/sail/sync.c +++ b/games/sail/sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sync.c,v 1.10 2011/06/20 17:40:55 miod Exp $ */ +/* $OpenBSD: sync.c,v 1.11 2014/11/16 04:49:48 guenther Exp $ */ /* $NetBSD: sync.c,v 1.9 1998/08/30 09:19:40 veego Exp $ */ /* @@ -30,14 +30,14 @@ * SUCH DAMAGE. */ +#include <sys/types.h> +#include <sys/stat.h> + #include <fcntl.h> #include <errno.h> #include <stdarg.h> #include <stdlib.h> #include <unistd.h> -#include <sys/file.h> -#include <sys/types.h> -#include <sys/stat.h> #include <time.h> #include "extern.h" #include "pathnames.h" diff --git a/games/snake/snake.c b/games/snake/snake.c index d6ce2d4482d..e74e616435b 100644 --- a/games/snake/snake.c +++ b/games/snake/snake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: snake.c,v 1.15 2013/08/29 20:22:20 naddy Exp $ */ +/* $OpenBSD: snake.c,v 1.16 2014/11/16 04:49:49 guenther Exp $ */ /* $NetBSD: snake.c,v 1.8 1995/04/29 00:06:41 mycroft Exp $ */ /* @@ -41,7 +41,6 @@ * cc -O snake.c move.c -o snake -lm -lcurses */ -#include <sys/param.h> #include <sys/types.h> #include <sys/ioctl.h> @@ -184,7 +183,7 @@ main(int argc, char *argv[]) if (!ccnt || ccnt > COLS - 3) ccnt = COLS - 3; - i = MIN(lcnt, ccnt); + i = lcnt < ccnt ? lcnt : ccnt; if (i < 4) { endwin(); errx(1, "screen too small for a fair game."); diff --git a/games/tetris/scores.c b/games/tetris/scores.c index 5f52b02b706..6903d6221cb 100644 --- a/games/tetris/scores.c +++ b/games/tetris/scores.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.c,v 1.11 2006/04/20 03:25:36 ray Exp $ */ +/* $OpenBSD: scores.c,v 1.12 2014/11/16 04:49:49 guenther Exp $ */ /* $NetBSD: scores.c,v 1.2 1995/04/22 07:42:38 cgd Exp $ */ /*- @@ -42,9 +42,13 @@ * * Major whacks since then. */ +#include <sys/types.h> +#include <sys/stat.h> + #include <errno.h> #include <err.h> #include <fcntl.h> +#include <limits.h> #include <pwd.h> #include <stdio.h> #include <stdlib.h> @@ -52,9 +56,6 @@ #include <time.h> #include <term.h> #include <unistd.h> -#include <sys/param.h> -#include <sys/stat.h> -#include <sys/types.h> #include "pathnames.h" #include "screen.h" diff --git a/games/tetris/scores.h b/games/tetris/scores.h index cd3f9d27b4b..6aaa0741a41 100644 --- a/games/tetris/scores.h +++ b/games/tetris/scores.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scores.h,v 1.5 2003/06/03 03:01:41 millert Exp $ */ +/* $OpenBSD: scores.h,v 1.6 2014/11/16 04:49:49 guenther Exp $ */ /* $NetBSD: scores.h,v 1.2 1995/04/22 07:42:40 cgd Exp $ */ /*- @@ -39,10 +39,10 @@ * Tetris scores. */ struct highscore { - char hs_name[MAXLOGNAME]; /* login name */ - int hs_score; /* raw score */ - int hs_level; /* play level */ - time_t hs_time; /* time at game end */ + char hs_name[LOGIN_NAME_MAX]; /* login name */ + int hs_score; /* raw score */ + int hs_level; /* play level */ + time_t hs_time; /* time at game end */ }; #define MAXHISCORES 80 diff --git a/games/tetris/tetris.c b/games/tetris/tetris.c index 7e7bc9f281a..eff466b7b5f 100644 --- a/games/tetris/tetris.c +++ b/games/tetris/tetris.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tetris.c,v 1.24 2013/08/29 20:22:20 naddy Exp $ */ +/* $OpenBSD: tetris.c,v 1.25 2014/11/16 04:49:49 guenther Exp $ */ /* $NetBSD: tetris.c,v 1.2 1995/04/22 07:42:47 cgd Exp $ */ /*- @@ -39,11 +39,11 @@ * Tetris (or however it is spelled). */ -#include <sys/param.h> #include <sys/time.h> #include <sys/types.h> #include <err.h> +#include <limits.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> |