]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lslogins: remove duplicate NULL check
authorSami Kerola <kerolasa@iki.fi>
Mon, 10 Dec 2018 20:41:18 +0000 (20:41 +0000)
committerSami Kerola <kerolasa@iki.fi>
Mon, 10 Dec 2018 20:41:18 +0000 (20:41 +0000)
Having this excess NULL check in place causes small performance penalty, and
makes compiler to guess wrong if a null should be checked.  To me getting
rid of false positive warning is more useful.

login-utils/lslogins.c:634:7: warning: potential null pointer dereference
[-Wnull-dereference]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
login-utils/lslogins.c

index e2a0d43df7d4d3d045876743357ab1232d9329fb..280768e7a98c59b32f92df18f82b358648a74b00 100644 (file)
@@ -623,7 +623,7 @@ static int valid_pwd(const char *str)
                return 0;
 
        /* salt$ */
-       for (; p && *p; p++) {
+       for (; *p; p++) {
                if (*p == '$') {
                        p++;
                        break;