From 84da62974d0325481044f49a03984c5e47eaf927 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 31 Jul 2021 11:10:57 -0700 Subject: [PATCH] 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. --- src/numfmt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'; -- 2.47.2