mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(main): Diagnose invalid suffix on obsolescent width specifications like `-72x'.
This commit is contained in:
1 parent
7f5d536dc3
commit
7747a57abc
1 file changed
+5
-1
@@ -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++;
|
||||
|
||||
Reference in new issue
Block a user