diff options
author | Jim Meyering <jim@meyering.net> | 2005-03-17 15:32:10 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2005-03-17 15:32:10 +0000 |
commit | 3bf5718c30d937bce9b383ff4ebe2eb2a6209a08 (patch) | |
tree | 8d605613c6fdcbf43e5b38a8f7a9086bc6bb14da /src | |
parent | b90c3e46097a222eaeac27941b11968d6933fe47 (diff) | |
download | coreutils-3bf5718c30d937bce9b383ff4ebe2eb2a6209a08.tar.xz |
(main): Use DECIMAL_DIGIT_ACCUMULATE macro in place of nearly-equivalent code.
Diffstat (limited to 'src')
-rw-r--r-- | src/split.c | 6 |
1 files changed, 2 insertions, 4 deletions
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': |