diff options
author | Jim Meyering <jim@meyering.net> | 2002-09-29 18:06:02 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-09-29 18:06:02 +0000 |
commit | c791a382f8a88c292d7682f7720e021e5ea22292 (patch) | |
tree | 0576a49d36bc1b1650c2ab712f45237b220b5756 | |
parent | d27ac3d82a7e7f59f7e7670fd04f661e0d24c7e7 (diff) | |
download | coreutils-c791a382f8a88c292d7682f7720e021e5ea22292.tar.xz |
(parse_options): Give a sensible diagnostic for
an invalid byte or line count. Reported by Mikko Tuumanen.
-rw-r--r-- | src/tail.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/tail.c b/src/tail.c index 0d5ea589b..ba9dc8cf0 100644 --- a/src/tail.c +++ b/src/tail.c @@ -1460,7 +1460,7 @@ parse_options (int argc, char **argv, strtol_error s_err; uintmax_t n; s_err = xstrtoumax (optarg, NULL, 10, &n, "bkm"); - if (s_err == LONGINT_INVALID) + if (s_err != LONGINT_OK) { error (EXIT_FAILURE, 0, "%s: %s", optarg, (c == 'n' @@ -1468,13 +1468,9 @@ parse_options (int argc, char **argv, : _("invalid number of bytes"))); } - if (s_err != LONGINT_OK) - error (EXIT_FAILURE, 0, - _("%s: is so large that it is not representable"), optarg); - if (OFF_T_MAX < n) error (EXIT_FAILURE, 0, - _("%s is larger than the maximum file size on this system"), + _("%s is larger than the maximum file size on this system"), optarg); *n_units = (off_t) n; } |