]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(parse_options): Give a sensible diagnostic for
authorJim Meyering <jim@meyering.net>
Sun, 29 Sep 2002 18:06:02 +0000 (18:06 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 29 Sep 2002 18:06:02 +0000 (18:06 +0000)
an invalid byte or line count.  Reported by Mikko Tuumanen.

src/tail.c

index 0d5ea589bb9f469a729a16b680ee62fa5e18f514..ba9dc8cf0aa23e7f8420ab5eb09a152af9877001 100644 (file)
@@ -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;
          }