]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
numfmt: omit unnecessary pointer test
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 31 Jul 2021 18:10:57 +0000 (11:10 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 31 Jul 2021 18:17:18 +0000 (11:17 -0700)
Caught by GCC 11.1 -fanalyzer.
* src/numfmt.c (simple_strtod_int): Remove unnecessary test of
*endptr vs NULL.  Presumably this was a typo and **endptr was
intended instead of *endptr, but an **endptr test is also
unnecessary since c_isdigit (0) returns false.

src/numfmt.c

index fda03b4ddf411e7012e80e92bf0d744225bfc673..35209591a7a8b13a739f76a677080ee659784ead 100644 (file)
@@ -480,7 +480,7 @@ simple_strtod_int (char const *input_str,
     *negative = false;
 
   *endptr = (char *) input_str;
-  while (*endptr && c_isdigit (**endptr))
+  while (c_isdigit (**endptr))
     {
       int digit = (**endptr) - '0';