summaryrefslogtreecommitdiff
path: root/usr.bin/fmt
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-12-14 21:50:33 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-12-14 21:50:33 +0000
commitd0cf8dfa89674c8de499df89459cf130f87a32fe (patch)
treee427759038f3dced746dfbd8a047ee8ecf352b90 /usr.bin/fmt
parent6be14c63e1357dd9a86cb69da564552994e364a3 (diff)
adjust argv and argc correctly when reading max from command line
Diffstat (limited to 'usr.bin/fmt')
-rw-r--r--usr.bin/fmt/fmt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/fmt/fmt.c b/usr.bin/fmt/fmt.c
index ee97ee2d7d8..d45b6b02e7f 100644
--- a/usr.bin/fmt/fmt.c
+++ b/usr.bin/fmt/fmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fmt.c,v 1.12 1998/12/14 21:48:10 millert Exp $ */
+/* $OpenBSD: fmt.c,v 1.13 1998/12/14 21:50:32 millert Exp $ */
/* Sensible version of fmt
*
@@ -168,7 +168,7 @@
#ifndef lint
static const char rcsid[] =
- "$OpenBSD: fmt.c,v 1.12 1998/12/14 21:48:10 millert Exp $";
+ "$OpenBSD: fmt.c,v 1.13 1998/12/14 21:50:32 millert Exp $";
static const char copyright[] =
"Copyright (c) 1997 Gareth McCaughan. All rights reserved.\n";
#endif /* not lint */
@@ -331,6 +331,7 @@ main(int argc, char *argv[]) {
if (argc>0
&& (max_length=get_positive(*argv,"max length must be positive", 0))
!= 0) {
+ --argc; ++argv;
if (max_length<goal_length)
errx(EX_USAGE, "max length must be >= goal length");
}