summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-07-31 11:10:57 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-07-31 11:17:18 -0700
commit84da62974d0325481044f49a03984c5e47eaf927 (patch)
treeaac548af1f734af9fa8cd6627d702ea8e685181f
parentdoc: add options summary list to tr texinfo (diff)
downloadcoreutils-84da62974d0325481044f49a03984c5e47eaf927.tar.gz
coreutils-84da62974d0325481044f49a03984c5e47eaf927.zip
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.
-rw-r--r--src/numfmt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/numfmt.c b/src/numfmt.c
index fda03b4dd..35209591a 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';