From: tedu Date: Fri, 23 Oct 2015 08:18:30 +0000 (+0000) Subject: cleanup argv handling a bit X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=54204f4834c76e31cbdb689a45e0dca886065280;p=openbsd cleanup argv handling a bit --- diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index 878a0eed164..ab6f05ebd36 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfsstat.c,v 1.34 2015/01/16 06:40:10 deraadt Exp $ */ +/* $OpenBSD: nfsstat.c,v 1.35 2015/10/23 08:18:30 tedu Exp $ */ /* $NetBSD: nfsstat.c,v 1.7 1996/03/03 17:21:30 thorpej Exp $ */ /* @@ -112,19 +112,13 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; -#define BACKWARD_COMPATIBILITY -#ifdef BACKWARD_COMPATIBILITY - if (*argv) { + if (argc) { interval = (u_int)strtonum(*argv, 0, 1000, &errstr); if (errstr) errx(1, "invalid interval %s: %s", *argv, errstr); - if (*++argv) { - nlistf = *argv; - if (*++argv) - memf = *argv; - } + ++argv; + --argc; } -#endif if (nlistf || memf) { char errbuf[_POSIX2_LINE_MAX];