diff options
author | Jim Meyering <jim@meyering.net> | 2003-05-02 19:15:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-05-02 19:15:19 +0000 |
commit | 7747a57abcc9f2863018b7ff5acbd2d451ee0cfe (patch) | |
tree | cc7607b9c7bf7f4deb760be996e96fa3a8f9076a | |
parent | 7f5d536dc3db9aca29dc11c5a9f71b0ab681818d (diff) | |
download | coreutils-7747a57abcc9f2863018b7ff5acbd2d451ee0cfe.tar.xz |
(main): Diagnose invalid suffix on obsolescent width specifications like `-72x'.
-rw-r--r-- | src/fmt.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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++; |