From: Jim Meyering Date: Fri, 2 May 2003 19:15:19 +0000 (+0000) Subject: (main): Diagnose invalid suffix on obsolescent width specifications like `-72x'. X-Git-Tag: v5.0.1~621 X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=7747a57abcc9f2863018b7ff5acbd2d451ee0cfe;p=thirdparty%2Fcoreutils.git (main): Diagnose invalid suffix on obsolescent width specifications like `-72x'. --- diff --git a/src/fmt.c b/src/fmt.c index c6fe5ba40e..b1fb67bf77 100644 --- 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++;