From: Sami Kerola Date: Mon, 10 Dec 2018 20:41:18 +0000 (+0000) Subject: lslogins: remove duplicate NULL check X-Git-Tag: v2.34-rc1~185^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a81a48779b858b7ab49fff3ed52dec21a26049a5;p=thirdparty%2Futil-linux.git lslogins: remove duplicate NULL check 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 --- diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c index e2a0d43df7..280768e7a9 100644 --- a/login-utils/lslogins.c +++ b/login-utils/lslogins.c @@ -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;