diff options
author | 2002-12-08 03:14:29 +0000 | |
---|---|---|
committer | 2002-12-08 03:14:29 +0000 | |
commit | 23961133bca9693fe45a570b90a5a31ed07155ea (patch) | |
tree | bdbcd77cf429e794bd2da43ec0e825f3737e06a5 | |
parent | test options on altq and queue rules in fancy order (diff) | |
download | wireguard-openbsd-23961133bca9693fe45a570b90a5a31ed07155ea.tar.xz wireguard-openbsd-23961133bca9693fe45a570b90a5a31ed07155ea.zip |
Avoid using "optind = 0" since its meaning to getopt() is implementation
dependent (and there is no good reason to use it in this case anyway).
-rw-r--r-- | usr.bin/xlint/xlint/xlint.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.bin/xlint/xlint/xlint.c b/usr.bin/xlint/xlint/xlint.c index 497aaaaa4d3..dafa1f48dcd 100644 --- a/usr.bin/xlint/xlint/xlint.c +++ b/usr.bin/xlint/xlint/xlint.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $ */ +/* $OpenBSD: xlint.c,v 1.11 2002/12/08 03:14:29 millert Exp $ */ /* $NetBSD: xlint.c,v 1.3 1995/10/23 14:29:30 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: xlint.c,v 1.10 2002/06/12 06:07:17 mpech Exp $"; +static char rcsid[] = "$OpenBSD: xlint.c,v 1.11 2002/12/08 03:14:29 millert Exp $"; #endif #include <sys/param.h> @@ -357,11 +357,6 @@ main(argc, argv) (void)signal(SIGTERM, terminate); while (argc > optind) { - - argc -= optind; - argv += optind; - optind = 0; - c = getopt(argc, argv, "abceghil:no:prstuvxzC:D:FHI:L:U:V"); switch (c) { @@ -482,12 +477,13 @@ main(argc, argv) case -1: /* filename */ - fname(argv[0], argc == 1); + fname(argv[optind++], argc == 1); first = 0; - optind = 1; } } + argc -= optind; + argv += optind; if (first) usage(); |