mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-17 18:02:09 +03:00
(parse_tab_stops, main): Update use of DECIMAL_DIGIT_ACCUMULATE.
This commit is contained in:
1 parent
0d22e40caf
commit
3bf2d948e7
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -172,7 +172,7 @@ parse_tab_stops (char const *stops)
|
||||
}
|
||||
{
|
||||
/* Detect overflow. */
|
||||
if (DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', UINTMAX_MAX))
|
||||
if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', UINTMAX_MAX))
|
||||
{
|
||||
size_t len = strspn (num_start, "0123456789");
|
||||
char *bad_num = xstrndup (num_start, len);
|
||||
@@ -419,7 +419,7 @@ main (int argc, char **argv)
|
||||
have_tabval = true;
|
||||
}
|
||||
{
|
||||
if (DECIMAL_DIGIT_ACCUMULATE (tabval, c - '0', UINTMAX_MAX))
|
||||
if (!DECIMAL_DIGIT_ACCUMULATE (tabval, c - '0', UINTMAX_MAX))
|
||||
error (EXIT_FAILURE, 0, _("tab stop value is too large"));
|
||||
}
|
||||
obsolete_tablist = true;
|
||||
|
||||
+2
-2
@@ -193,7 +193,7 @@ parse_tab_stops (char const *stops)
|
||||
}
|
||||
{
|
||||
/* Detect overflow. */
|
||||
if (DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', UINTMAX_MAX))
|
||||
if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', UINTMAX_MAX))
|
||||
{
|
||||
size_t len = strspn (num_start, "0123456789");
|
||||
char *bad_num = xstrndup (num_start, len);
|
||||
@@ -517,7 +517,7 @@ main (int argc, char **argv)
|
||||
have_tabval = true;
|
||||
}
|
||||
{
|
||||
if (DECIMAL_DIGIT_ACCUMULATE (tabval, c - '0', UINTMAX_MAX))
|
||||
if (!DECIMAL_DIGIT_ACCUMULATE (tabval, c - '0', UINTMAX_MAX))
|
||||
error (EXIT_FAILURE, 0, _("tab stop value is too large"));
|
||||
}
|
||||
obsolete_tablist = true;
|
||||
|
||||
Reference in new issue
Block a user