]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Diagnose invalid suffix on obsolescent width specifications like `-72x'.
authorJim Meyering <jim@meyering.net>
Fri, 2 May 2003 19:15:19 +0000 (19:15 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 2 May 2003 19:15:19 +0000 (19:15 +0000)
src/fmt.c

index c6fe5ba40e493ca3e359895849c9bea493a31cab..b1fb67bf7737b95fc255b90011b5a2fd34bb3bf8 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -342,8 +342,12 @@ main (register int argc, register char **argv)
          int old_max = max_width;
          max_width = max_width * 10 + *s - '0';
          if (INT_MAX / 10 < old_max || max_width < old_max)
-           error (EXIT_FAILURE, 0, _("invalid width option: `%s'"), argv[1]);
+           break;
        }
+
+      if (*s)
+       error (EXIT_FAILURE, 0, _("invalid width option: `%s'"), argv[1]);
+
       /* Make the options we just parsed invisible to getopt. */
       argv[1] = argv[0];
       argv++;