summaryrefslogtreecommitdiffstats
path: root/usr.bin/getopt/getopt.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1997-03-29 04:34:07 +0000
committerimp <imp@FreeBSD.org>1997-03-29 04:34:07 +0000
commit141381e1cbdbd8001c13e9e8c0adbfc81d1b3cd0 (patch)
treeab151e53b638b3b80f31c7b8a8ab143c391d7b75 /usr.bin/getopt/getopt.c
parent167db5291223948e17d74470feff53f15777fcaf (diff)
downloadFreeBSD-src-141381e1cbdbd8001c13e9e8c0adbfc81d1b3cd0.zip
FreeBSD-src-141381e1cbdbd8001c13e9e8c0adbfc81d1b3cd0.tar.gz
compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
Diffstat (limited to 'usr.bin/getopt/getopt.c')
-rw-r--r--usr.bin/getopt/getopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/getopt/getopt.c b/usr.bin/getopt/getopt.c
index 03b0987..060e2c9 100644
--- a/usr.bin/getopt/getopt.c
+++ b/usr.bin/getopt/getopt.c
@@ -10,7 +10,7 @@ char *argv[];
int status = 0;
optind = 2; /* Past the program name and the option letters. */
- while ((c = getopt(argc, argv, argv[1])) != EOF)
+ while ((c = getopt(argc, argv, argv[1])) != -1)
switch (c) {
case '?':
status = 1; /* getopt routine gave message */
OpenPOWER on IntegriCloud