From 3bf5718c30d937bce9b383ff4ebe2eb2a6209a08 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 17 Mar 2005 15:32:10 +0000 Subject: (main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code. --- src/split.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/split.c') diff --git a/src/split.c b/src/split.c index 0e877bfc6..013a9f1ea 100644 --- a/src/split.c +++ b/src/split.c @@ -1,5 +1,5 @@ /* split.c -- split a file into pieces. - Copyright (C) 88, 91, 1995-2004 Free Software Foundation, Inc. + Copyright (C) 88, 91, 1995-2005 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -481,15 +481,13 @@ main (int argc, char **argv) if (digits_optind != 0 && digits_optind != this_optind) n_units = 0; /* More than one number given; ignore other. */ digits_optind = this_optind; - if (UINTMAX_MAX / 10 < n_units - || n_units * 10 + c - '0' < n_units * 10) + if (DECIMAL_DIGIT_ACCUMULATE (n_units, c - '0', UINTMAX_MAX)) { char buffer[INT_BUFSIZE_BOUND (uintmax_t)]; error (EXIT_FAILURE, 0, _("line count option -%s%c... is too large"), umaxtostr (n_units, buffer), c); } - n_units = n_units * 10 + c - '0'; break; case 'd': -- cgit v1.2.3-54-g00ecf