summaryrefslogtreecommitdiff
path: root/src/uniq.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2005-03-17 15:33:50 +0000
committerJim Meyering <jim@meyering.net>2005-03-17 15:33:50 +0000
commit9e1e48f018692c1cf285405d0221256cf0789000 (patch)
treec9dd213eb17341706f61817916943e4c47301235 /src/uniq.c
parentf864f6df1cf7f15cf05cd335e011849c9ae6dde4 (diff)
downloadcoreutils-9e1e48f018692c1cf285405d0221256cf0789000.tar.xz
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
Diffstat (limited to 'src/uniq.c')
-rw-r--r--src/uniq.c6
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;