From 9e1e48f018692c1cf285405d0221256cf0789000 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 17 Mar 2005 15:33:50 +0000 Subject: (main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code. --- src/uniq.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/uniq.c b/src/uniq.c index a21a5a41c..621b95309 100644 --- a/src/uniq.c +++ b/src/uniq.c @@ -487,12 +487,10 @@ main (int argc, char **argv) case '8': case '9': { - size_t s = skip_fields; if (skip_field_option_type == SFO_NEW) - s = 0; + skip_fields = 0; - skip_fields = s * 10 + optc - '0'; - if (SIZE_MAX / 10 < s || skip_fields < s) + if (DECIMAL_DIGIT_ACCUMULATE (skip_fields, optc - '0', SIZE_MAX)) error (EXIT_FAILURE, 0, "%s", _("invalid number of fields to skip")); skip_field_option_type = SFO_OBSOLETE; -- cgit v1.2.3-70-g09d2