return 0 on successful exit, compare getopt() result to -1 instead of EOF.

This commit is contained in:
mikel 1997-01-23 06:29:05 +00:00
parent 2e5a49b4b6
commit f5a8ade241

View File

@ -1,4 +1,4 @@
/* $NetBSD: whereis.c,v 1.6 1995/08/31 21:54:52 jtc Exp $ */
/* $NetBSD: whereis.c,v 1.7 1997/01/23 06:29:05 mikel Exp $ */
/*-
* Copyright (c) 1993
@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)whereis.c 8.3 (Berkeley) 5/4/95";
#endif
static char *rcsid = "$NetBSD: whereis.c,v 1.6 1995/08/31 21:54:52 jtc Exp $";
static char *rcsid = "$NetBSD: whereis.c,v 1.7 1997/01/23 06:29:05 mikel Exp $";
#endif /* not lint */
#include <sys/param.h>
@ -69,7 +69,7 @@ main(argc, argv)
int ch, sverrno, mib[2];
char *p, *t, *std, path[MAXPATHLEN];
while ((ch = getopt(argc, argv, "")) != EOF)
while ((ch = getopt(argc, argv, "")) != -1)
switch (ch) {
case '?':
default:
@ -114,6 +114,8 @@ main(argc, argv)
if (p == NULL)
break;
}
return (0);
}
void