getopt returns -1 not EOF

This commit is contained in:
lukem 1997-10-17 13:49:37 +00:00
parent d2d85e1519
commit 47852f1f67
3 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993, 1994\n\
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
__RCSID("$NetBSD: syslogd.c,v 1.15 1997/09/19 19:24:24 leo Exp $");
__RCSID("$NetBSD: syslogd.c,v 1.16 1997/10/17 13:49:37 lukem Exp $");
#endif
#endif /* not lint */
@ -222,7 +222,7 @@ main(argc, argv)
FILE *fp;
char *p, *line;
while ((ch = getopt(argc, argv, "dsf:m:p:")) != EOF)
while ((ch = getopt(argc, argv, "dsf:m:p:")) != -1)
switch(ch) {
case 'd': /* debug */
Debug++;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcpdchk.c,v 1.3 1997/10/14 05:17:35 cjs Exp $ */
/* $NetBSD: tcpdchk.c,v 1.4 1997/10/17 13:49:49 lukem Exp $ */
/*
* tcpdchk - examine all tcpd access control rules and inetd.conf entries
@ -21,7 +21,7 @@
#if 0
static char sccsid[] = "@(#) tcpdchk.c 1.7 96/02/11 17:01:34";
#else
__RCSID("$NetBSD: tcpdchk.c,v 1.3 1997/10/14 05:17:35 cjs Exp $");
__RCSID("$NetBSD: tcpdchk.c,v 1.4 1997/10/17 13:49:49 lukem Exp $");
#endif
#endif
@ -106,7 +106,7 @@ char **argv;
/*
* Parse the JCL.
*/
while ((c = getopt(argc, argv, "adi:v")) != EOF) {
while ((c = getopt(argc, argv, "adi:v")) != -1) {
switch (c) {
case 'a':
allow_check = 1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: tcpdump.c,v 1.6 1997/10/03 19:56:01 christos Exp $ */
/* $NetBSD: tcpdump.c,v 1.7 1997/10/17 13:50:26 lukem Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@ -29,7 +29,7 @@ static const char rcsid[] =
#else
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997\n\
The Regents of the University of California. All rights reserved.\n");
__RCSID("$NetBSD: tcpdump.c,v 1.6 1997/10/03 19:56:01 christos Exp $");
__RCSID("$NetBSD: tcpdump.c,v 1.7 1997/10/17 13:50:26 lukem Exp $");
#endif
#endif
@ -155,7 +155,7 @@ main(int argc, char **argv)
opterr = 0;
while (
(op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xY")) != EOF)
(op = getopt(argc, argv, "ac:defF:i:lnNOpqr:s:StT:vw:xY")) != -1)
switch (op) {
case 'a':