]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/strutils: remove redundant condition
authorKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 07:46:40 +0000 (09:46 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 18 Jul 2018 07:48:19 +0000 (09:48 +0200)
[util-linux-2.32.1/lib/strutils.c:122]: (style) Redundant condition: If 'EXPR == '0'', the comparison 'EXPR' is always true.

Reported-by: David Binderman <dcb314@hotmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/strutils.c

index c3c422216521406886d77f1d108be9d5c212469a..38fc8d6b5c4894f98e0fd3ee0662207aae5b7abd 100644 (file)
@@ -119,7 +119,7 @@ check_suffix:
                if (frac == 0 && *p && dp && strncmp(dp, p, dpsz) == 0) {
                        char *fstr = p + dpsz;
 
-                       for (p = fstr; *p && *p == '0'; p++)
+                       for (p = fstr; *p == '0'; p++)
                                frac_zeros++;
                        errno = 0, p = NULL;
                        frac = strtoumax(fstr, &p, 0);