]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
authorJim Meyering <jim@meyering.net>
Thu, 17 Mar 2005 15:33:50 +0000 (15:33 +0000)
committerJim Meyering <jim@meyering.net>
Thu, 17 Mar 2005 15:33:50 +0000 (15:33 +0000)
src/uniq.c

index a21a5a41c87ee7e56469a270e9f2ff5cb0ef5319..621b95309351c7b24f58bcc861612e1b966f9773 100644 (file)
@@ -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;