(parse_obsolescent_option): Do not limit the maximum
authorJim Meyering <jim@meyering.net>
Mon, 29 Apr 2002 07:30:57 +0000 (07:30 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 29 Apr 2002 07:30:57 +0000 (07:30 +0000)
line/byte count to be less than ULONG_MAX on systems where
OFF_T_MAX is larger.

src/tail.c

index 23ad663..73b3ab7 100644 (file)
@@ -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.  */