summaryrefslogtreecommitdiff
path: root/sbin/ipf
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-02-08 18:59:00 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-02-08 18:59:00 +0000
commitd7dc54ab264d3f539f4f08f8ebacfcb5037ac778 (patch)
treecbcc69aef897f5e373b80ed8d1eab7c1f6df5622 /sbin/ipf
parent1ecf4d0dd69d36cf7cfd45d31ff61b49dbf702f3 (diff)
back out last change, there was a reason for the dual getopt, ugly as it is...
Diffstat (limited to 'sbin/ipf')
-rw-r--r--sbin/ipf/ipf.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sbin/ipf/ipf.c b/sbin/ipf/ipf.c
index b9926da8497..5a612c8f0dd 100644
--- a/sbin/ipf/ipf.c
+++ b/sbin/ipf/ipf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipf.c,v 1.16 1999/02/08 18:29:11 millert Exp $ */
+/* $OpenBSD: ipf.c,v 1.17 1999/02/08 18:58:59 millert Exp $ */
/*
* Copyright (C) 1993-1998 by Darren Reed.
*
@@ -45,7 +45,7 @@
#if !defined(lint)
static const char sccsid[] = "@(#)ipf.c 1.23 6/5/96 (C) 1993-1995 Darren Reed";
-static const char rcsid[] = "@(#)$Id: ipf.c,v 1.16 1999/02/08 18:29:11 millert Exp $";
+static const char rcsid[] = "@(#)$Id: ipf.c,v 1.17 1999/02/08 18:58:59 millert Exp $";
#endif
static void frsync __P((void));
@@ -57,6 +57,8 @@ extern char *index __P((const char *, int));
#endif
extern char *optarg;
+extern int optind;
+extern int optreset;
void zerostats __P((void));
int main __P((int, char *[]));
@@ -88,6 +90,12 @@ char *argv[];
{
int c;
+ while ((c = getopt(argc, argv, OPTS)) != -1)
+ if (c == '?')
+ usage();
+
+ optreset = 1;
+ optind = 1;
while ((c = getopt(argc, argv, OPTS)) != -1) {
switch (c)
{
@@ -147,9 +155,6 @@ char *argv[];
case 'Z' :
zerostats();
break;
- default :
- usage();
- break;
}
}