]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
`join -1 x' would give a misleading diagnostic
authorJim Meyering <jim@meyering.net>
Wed, 10 Mar 2004 10:44:31 +0000 (10:44 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 10 Mar 2004 10:44:31 +0000 (10:44 +0000)
(string_to_join_field): Report that a non-numeric field
number is invalid, rather than `so large that it is not representable'.

src/join.c

index db875ec3219201ab4bc1a0cfcadcb41e9d8d0e1d..2716ae339fc21d1cf8eaef7319d3e6d42e02cdaa 100644 (file)
@@ -642,7 +642,7 @@ string_to_join_field (char const *str, char const *err_msg_fmt)
   uintmax_t val;
 
   strtol_error s_err = xstrtoumax (str, NULL, 10, &val, "");
-  if (s_err == LONGINT_OVERFLOW || SIZE_MAX < val)
+  if (s_err == LONGINT_OVERFLOW || (s_err == LONGINT_OK && SIZE_MAX < val))
     {
       error (EXIT_FAILURE, 0,
             _("value %s is so large that it is not representable"),