From: Paul Eggert Date: Sat, 31 Jul 2021 18:10:57 +0000 (-0700) Subject: numfmt: omit unnecessary pointer test X-Git-Tag: v9.0~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84da62974d0325481044f49a03984c5e47eaf927;p=thirdparty%2Fcoreutils.git numfmt: omit unnecessary pointer test 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. --- diff --git a/src/numfmt.c b/src/numfmt.c index fda03b4ddf..35209591a7 100644 --- a/src/numfmt.c +++ b/src/numfmt.c @@ -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';