diff options
author | Jim Meyering <jim@meyering.net> | 2005-03-17 15:33:50 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-03-17 15:33:50 +0000 |
commit | 9e1e48f018692c1cf285405d0221256cf0789000 (patch) | |
tree | c9dd213eb17341706f61817916943e4c47301235 | |
parent | f864f6df1cf7f15cf05cd335e011849c9ae6dde4 (diff) | |
download | coreutils-9e1e48f018692c1cf285405d0221256cf0789000.tar.xz |
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
-rw-r--r-- | src/uniq.c | 6 |
1 files 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; |