From e0e186091a777dfe9cf3c22deeff989f459d8db9 Mon Sep 17 00:00:00 2001 From: hubertf Date: Wed, 10 Feb 1999 00:29:21 +0000 Subject: The patch below does some minor cleanup of adventure(6): an additional use of const I missed in bin/6041; avoiding a signed/unsigned warning; marking an unused parameter as such; revoking setgid privileges (including the saved gid) rather than setuid ones; includes and function prototypes in setup.c; the string passed to err() should not end with a `.'. Together with the patch sent concerning adventure's EOF handling, this synchronises adventure(6) in NetBSD with the Linux port of the NetBSD games. Via PR 6557 by Joseph Myers --- adventure/setup.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'adventure/setup.c') diff --git a/adventure/setup.c b/adventure/setup.c index 71cff65c..89c3100a 100644 --- a/adventure/setup.c +++ b/adventure/setup.c @@ -1,4 +1,4 @@ -/* $NetBSD: setup.c,v 1.5 1998/09/13 15:23:40 hubertf Exp $ */ +/* $NetBSD: setup.c,v 1.6 1999/02/10 00:29:21 hubertf Exp $ */ /*- * Copyright (c) 1991, 1993 @@ -46,7 +46,7 @@ __COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\ #if 0 static char sccsid[] = "@(#)setup.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: setup.c,v 1.5 1998/09/13 15:23:40 hubertf Exp $"); +__RCSID("$NetBSD: setup.c,v 1.6 1999/02/10 00:29:21 hubertf Exp $"); #endif #endif /* not lint */ @@ -64,6 +64,8 @@ __RCSID("$NetBSD: setup.c,v 1.5 1998/09/13 15:23:40 hubertf Exp $"); #define SIG2 " * Sterday, 6 Thrimidge S.R. 1993, 15:24" #include +#include +#include #include "hdr.h" /* SEED lives in there; keep them coordinated. */ #define USAGE "Usage: setup file > data.c (file is typically glorkz)" @@ -73,6 +75,8 @@ __RCSID("$NetBSD: setup.c,v 1.5 1998/09/13 15:23:40 hubertf Exp $"); #define LINE 10 /* How many values do we get on a line? */ +int main __P((int, char *[])); + int main(argc, argv) int argc; @@ -85,7 +89,7 @@ main(argc, argv) errx(1, USAGE); if ((infile = fopen(argv[1], "r")) == NULL) - err(1, "Can't read file %s.", argv[1]); + err(1, "Can't read file %s", argv[1]); puts("/*\n * data.c: created by setup from the ascii data file."); puts(SIG1); puts(SIG2); -- cgit v1.2.3-56-ge451