summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pechkin <mpech@cvs.openbsd.org>2001-10-24 13:06:37 +0000
committerMike Pechkin <mpech@cvs.openbsd.org>2001-10-24 13:06:37 +0000
commit9531af194e3d30d1d195cd6cee8ddf4e13f5e668 (patch)
tree50e73d1a354adfd017b644ec37a53be2492d04a7
parenta8300e86e7f5e26893c1db0e382f2f2ce983954c (diff)
getopt(3) returns -1 when out of args, not EOF.
millert@ ok
-rw-r--r--libexec/ld.so/ldconfig/ldconfig.c4
-rw-r--r--libexec/ld.so/test/dltest.c4
-rw-r--r--libexec/login_chpass/login_chpass.c4
-rw-r--r--libexec/login_lchpass/login_lchpass.c4
-rw-r--r--libexec/login_reject/login_reject.c4
-rw-r--r--libexec/login_skey/login_skey.c4
-rw-r--r--libexec/login_token/login_token.c4
-rw-r--r--usr.bin/infocmp/infocmp.c4
-rw-r--r--usr.sbin/named/dnsquery/dnsquery.c4
-rw-r--r--usr.sbin/named/named-xfer/named-xfer.c8
-rw-r--r--usr.sbin/tokenadm/tokenadm.c4
-rw-r--r--usr.sbin/tokeninit/tokeninit.c4
12 files changed, 26 insertions, 26 deletions
diff --git a/libexec/ld.so/ldconfig/ldconfig.c b/libexec/ld.so/ldconfig/ldconfig.c
index 39bc9891265..b972c1c970d 100644
--- a/libexec/ld.so/ldconfig/ldconfig.c
+++ b/libexec/ld.so/ldconfig/ldconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldconfig.c,v 1.4 2001/05/11 13:31:42 art Exp $ */
+/* $OpenBSD: ldconfig.c,v 1.5 2001/10/24 13:06:35 mpech Exp $ */
/*
* Copyright (c) 1993,1995 Paul Kranenburg
@@ -93,7 +93,7 @@ char *argv[];
int i, c;
int rval = 0;
- while ((c = getopt(argc, argv, "RUmrsv")) != EOF) {
+ while ((c = getopt(argc, argv, "RUmrsv")) != -1) {
switch (c) {
case 'R':
rescan = 1;
diff --git a/libexec/ld.so/test/dltest.c b/libexec/ld.so/test/dltest.c
index 77420d5f69e..3293cdf3e12 100644
--- a/libexec/ld.so/test/dltest.c
+++ b/libexec/ld.so/test/dltest.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dltest.c,v 1.4 2001/09/25 21:51:16 drahn Exp $ */
+/* $OpenBSD: dltest.c,v 1.5 2001/10/24 13:06:35 mpech Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -35,7 +35,7 @@ main(int argc, char **argv)
int ch;
int mode;
- while((ch = getopt(argc, argv, "a:b:f:l:")) != EOF) {
+ while((ch = getopt(argc, argv, "a:b:f:l:")) != -1) {
switch(ch) {
case 'a':
param = optarg;
diff --git a/libexec/login_chpass/login_chpass.c b/libexec/login_chpass/login_chpass.c
index a0e29cba30c..a3ef0a0d20e 100644
--- a/libexec/login_chpass/login_chpass.c
+++ b/libexec/login_chpass/login_chpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_chpass.c,v 1.1 2000/12/12 02:30:44 millert Exp $ */
+/* $OpenBSD: login_chpass.c,v 1.2 2001/10/24 13:06:35 mpech Exp $ */
/*-
* Copyright (c) 1995,1996 Berkeley Software Design, Inc. All rights reserved.
@@ -105,7 +105,7 @@ main(argc, argv)
openlog("login", LOG_ODELAY, LOG_AUTH);
- while ((c = getopt(argc, argv, "s:v:")) != EOF)
+ while ((c = getopt(argc, argv, "s:v:")) != -1)
switch(c) {
case 'v':
break;
diff --git a/libexec/login_lchpass/login_lchpass.c b/libexec/login_lchpass/login_lchpass.c
index 911dcc2be23..fd29ac27d3c 100644
--- a/libexec/login_lchpass/login_lchpass.c
+++ b/libexec/login_lchpass/login_lchpass.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_lchpass.c,v 1.2 2001/06/25 22:10:28 millert Exp $ */
+/* $OpenBSD: login_lchpass.c,v 1.3 2001/10/24 13:06:35 mpech Exp $ */
/*-
* Copyright (c) 1995,1996 Berkeley Software Design, Inc. All rights reserved.
@@ -81,7 +81,7 @@ main(argc, argv)
if (gethostname(localhost, sizeof(localhost)) < 0)
syslog(LOG_ERR, "couldn't get local hostname: %m");
- while ((c = getopt(argc, argv, "v:s:")) != EOF)
+ while ((c = getopt(argc, argv, "v:s:")) != -1)
switch(c) {
case 'v':
break;
diff --git a/libexec/login_reject/login_reject.c b/libexec/login_reject/login_reject.c
index e1dff6fe3c0..92d8bfe909f 100644
--- a/libexec/login_reject/login_reject.c
+++ b/libexec/login_reject/login_reject.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_reject.c,v 1.1 2000/12/12 02:34:43 millert Exp $ */
+/* $OpenBSD: login_reject.c,v 1.2 2001/10/24 13:06:35 mpech Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -73,7 +73,7 @@ main(argc, argv)
openlog("login", LOG_ODELAY, LOG_AUTH);
- while ((c = getopt(argc, argv, "v:s:")) != EOF)
+ while ((c = getopt(argc, argv, "v:s:")) != -1)
switch(c) {
case 'v':
break;
diff --git a/libexec/login_skey/login_skey.c b/libexec/login_skey/login_skey.c
index 0b26d5dfa8c..6d0cf6938bd 100644
--- a/libexec/login_skey/login_skey.c
+++ b/libexec/login_skey/login_skey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_skey.c,v 1.3 2001/06/25 22:10:29 millert Exp $ */
+/* $OpenBSD: login_skey.c,v 1.4 2001/10/24 13:06:35 mpech Exp $ */
/*-
* Copyright (c) 1995 Berkeley Software Design, Inc. All rights reserved.
@@ -80,7 +80,7 @@ main(argc, argv)
openlog(NULL, LOG_ODELAY, LOG_AUTH);
- while ((c = getopt(argc, argv, "ds:v:")) != EOF)
+ while ((c = getopt(argc, argv, "ds:v:")) != -1)
switch(c) {
case 'd': /* to remain undocumented */
back = stdout;
diff --git a/libexec/login_token/login_token.c b/libexec/login_token/login_token.c
index 4ba3344fea4..c03dd49bd2d 100644
--- a/libexec/login_token/login_token.c
+++ b/libexec/login_token/login_token.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_token.c,v 1.2 2000/12/20 20:08:23 markus Exp $ */
+/* $OpenBSD: login_token.c,v 1.3 2001/10/24 13:06:36 mpech Exp $ */
/*-
* Copyright (c) 1995, 1996 Berkeley Software Design, Inc. All rights reserved.
@@ -83,7 +83,7 @@ main(argc, argv)
errx(1, "unknown token type");
}
- while ((c = getopt(argc, argv, "ds:v:")) != EOF)
+ while ((c = getopt(argc, argv, "ds:v:")) != -1)
switch(c) {
case 'd': /* to remain undocumented */
back = stdout;
diff --git a/usr.bin/infocmp/infocmp.c b/usr.bin/infocmp/infocmp.c
index 93c1f055073..91a1b6181db 100644
--- a/usr.bin/infocmp/infocmp.c
+++ b/usr.bin/infocmp/infocmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: infocmp.c,v 1.13 2001/02/28 22:58:52 millert Exp $ */
+/* $OpenBSD: infocmp.c,v 1.14 2001/10/24 13:06:36 mpech Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -1135,7 +1135,7 @@ main(int argc, char *argv[])
/* where is the terminfo database location going to default to? */
restdir = firstdir = 0;
- while ((c = getopt(argc, argv, "adeEcCfFGgIinlLpqrR:s:uv:Vw:A:B:1T")) != EOF)
+ while ((c = getopt(argc, argv, "adeEcCfFGgIinlLpqrR:s:uv:Vw:A:B:1T")) != -1)
switch (c) {
#if NCURSES_XNAMES
case 'a':
diff --git a/usr.sbin/named/dnsquery/dnsquery.c b/usr.sbin/named/dnsquery/dnsquery.c
index 26ccf6bda5c..66b82311e53 100644
--- a/usr.sbin/named/dnsquery/dnsquery.c
+++ b/usr.sbin/named/dnsquery/dnsquery.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dnsquery.c,v 1.5 2000/02/01 03:24:02 deraadt Exp $ */
+/* $OpenBSD: dnsquery.c,v 1.6 2001/10/24 13:06:36 mpech Exp $ */
#include <stdio.h>
#include <sys/types.h>
@@ -43,7 +43,7 @@ char *argv[];
}
/* handle args */
- while ((c = getopt(argc, argv, "c:dh:n:p:r:st:u:v")) != EOF) {
+ while ((c = getopt(argc, argv, "c:dh:n:p:r:st:u:v")) != -1) {
switch (c) {
case 'r' : _res.retry = atoi(optarg);
diff --git a/usr.sbin/named/named-xfer/named-xfer.c b/usr.sbin/named/named-xfer/named-xfer.c
index ba4b5cdf887..858028dce61 100644
--- a/usr.sbin/named/named-xfer/named-xfer.c
+++ b/usr.sbin/named/named-xfer/named-xfer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: named-xfer.c,v 1.7 1998/08/16 21:20:03 millert Exp $ */
+/* $OpenBSD: named-xfer.c,v 1.8 2001/10/24 13:06:36 mpech Exp $ */
/*
* The original version of xfer by Kevin Dunlap.
@@ -97,7 +97,7 @@ char copyright[] =
static char sccsid[] = "@(#)named-xfer.c 4.18 (Berkeley) 3/7/91";
static char rcsid[] = "$From: named-xfer.c,v 8.24 1998/04/07 04:59:45 vixie Exp $";
#else
-static char rcsid[] = "$OpenBSD: named-xfer.c,v 1.7 1998/08/16 21:20:03 millert Exp $";
+static char rcsid[] = "$OpenBSD: named-xfer.c,v 1.8 2001/10/24 13:06:36 mpech Exp $";
#endif
#endif /* not lint */
@@ -221,9 +221,9 @@ main(argc, argv)
openlog(ProgName, LOG_PID);
#endif
#ifdef STUBS
- while ((c = getopt(argc, argv, "C:d:l:s:t:z:f:p:P:qS")) != EOF)
+ while ((c = getopt(argc, argv, "C:d:l:s:t:z:f:p:P:qS")) != -1)
#else
- while ((c = getopt(argc, argv, "C:d:l:s:t:z:f:p:P:q")) != EOF)
+ while ((c = getopt(argc, argv, "C:d:l:s:t:z:f:p:P:q")) != -1)
#endif
switch (c) {
#ifdef GEN_AXFR
diff --git a/usr.sbin/tokenadm/tokenadm.c b/usr.sbin/tokenadm/tokenadm.c
index 2385a922458..6ba981fc475 100644
--- a/usr.sbin/tokenadm/tokenadm.c
+++ b/usr.sbin/tokenadm/tokenadm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tokenadm.c,v 1.2 2001/05/30 20:43:02 markus Exp $ */
+/* $OpenBSD: tokenadm.c,v 1.3 2001/10/24 13:06:36 mpech Exp $ */
/*-
* Copyright (c) 1995 Migration Associates Corp. All Rights Reserved
@@ -102,7 +102,7 @@ main(int argc, char **argv)
if (setrlimit(RLIMIT_CORE, &cds) < 0)
syslog(LOG_ERR, "couldn't set core dump size to 0: %m");
- while ((c = getopt(argc, argv, "BDERT1bdem:ru")) != EOF)
+ while ((c = getopt(argc, argv, "BDERT1bdem:ru")) != -1)
switch (c) {
case 'B':
if (what != LIST)
diff --git a/usr.sbin/tokeninit/tokeninit.c b/usr.sbin/tokeninit/tokeninit.c
index 97f220f535b..2e56de30d05 100644
--- a/usr.sbin/tokeninit/tokeninit.c
+++ b/usr.sbin/tokeninit/tokeninit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tokeninit.c,v 1.2 2000/12/20 20:08:22 markus Exp $ */
+/* $OpenBSD: tokeninit.c,v 1.3 2001/10/24 13:06:36 mpech Exp $ */
/*-
* Copyright (c) 1995 Migration Associates Corp. All Rights Reserved
@@ -89,7 +89,7 @@ main(int argc, char **argv)
else
optstr = "fm:sv";
- while ((c = getopt(argc, argv, optstr)) != EOF)
+ while ((c = getopt(argc, argv, optstr)) != -1)
switch (c) {
case 'f': /* force initialize existing user account */
cmd |= TOKEN_FORCEINIT;