From: Jim Meyering Date: Mon, 29 Apr 2002 07:30:57 +0000 (+0000) Subject: (parse_obsolescent_option): Do not limit the maximum X-Git-Tag: SH-UTILS-2_0_12~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=676991e63002085ae302e101129cc48f56148d3e;p=thirdparty%2Fcoreutils.git (parse_obsolescent_option): Do not limit the maximum line/byte count to be less than ULONG_MAX on systems where OFF_T_MAX is larger. --- diff --git a/src/tail.c b/src/tail.c index 23ad663732..73b3ab717a 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1360,13 +1360,13 @@ parse_obsolescent_option (int argc, const char *const *argv, else { strtol_error s_err; - unsigned long int tmp_ulong; + uintmax_t tmp; char *end; - s_err = xstrtoul (n_string, &end, 10, &tmp_ulong, - *n_string_end == 'b' ? "b" : NULL); - if (s_err == LONGINT_OK && tmp_ulong <= OFF_T_MAX) - *n_units = (off_t) tmp_ulong; + s_err = xstrtoumax (n_string, &end, 10, &tmp, + *n_string_end == 'b' ? "b" : NULL); + if (s_err == LONGINT_OK && tmp <= OFF_T_MAX) + *n_units = (off_t) tmp; else { /* Extract a NUL-terminated string for the error message. */