From: Jim Meyering Date: Mon, 24 Oct 2005 07:28:39 +0000 (+0000) Subject: * src/expand.c (parse_tab_stops): Add comment to make this function X-Git-Tag: v6.0~1486 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57d5938b174238e4c70619ee64652c93679810ed;p=thirdparty%2Fcoreutils.git * src/expand.c (parse_tab_stops): Add comment to make this function identical to the one in unexpand.c. * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function identical to the one in expand.c. --- diff --git a/src/expand.c b/src/expand.c index bf857b0e45..b1b1004228 100644 --- a/src/expand.c +++ b/src/expand.c @@ -172,6 +172,7 @@ parse_tab_stops (char const *stops) num_start = stops; } + /* Detect overflow. */ if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) { size_t len = strspn (num_start, "0123456789"); diff --git a/src/unexpand.c b/src/unexpand.c index 5537ef8280..0f4e6710c4 100644 --- a/src/unexpand.c +++ b/src/unexpand.c @@ -190,18 +190,17 @@ parse_tab_stops (char const *stops) have_tabval = true; num_start = stops; } - { - /* Detect overflow. */ - if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) - { - size_t len = strspn (num_start, "0123456789"); - char *bad_num = xstrndup (num_start, len); - error (0, 0, _("tab stop is too large %s"), quote (bad_num)); - free (bad_num); - ok = false; - stops = num_start + len - 1; - } - } + + /* Detect overflow. */ + if (!DECIMAL_DIGIT_ACCUMULATE (tabval, *stops - '0', uintmax_t)) + { + size_t len = strspn (num_start, "0123456789"); + char *bad_num = xstrndup (num_start, len); + error (0, 0, _("tab stop is too large %s"), quote (bad_num)); + free (bad_num); + ok = false; + stops = num_start + len - 1; + } } else {