mirror of
https://github.com/openbsd/src.git
synced 2025-01-10 06:47:55 -08:00
getopt(3) returns -1 when out of args, not EOF.
millert@ ok
This commit is contained in:
parent
d6e39fe428
commit
d52e83b822
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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':
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user