util-linux/lslogins-remove-duplicate-NULL-check.patch
2019-09-30 11:19:16 -04:00

34 lines
965 B
Diff

From a81a48779b858b7ab49fff3ed52dec21a26049a5 Mon Sep 17 00:00:00 2001
From: Sami Kerola <kerolasa@iki.fi>
Date: Mon, 10 Dec 2018 20:41:18 +0000
Subject: [PATCH 556/686] 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 <kerolasa@iki.fi>
---
login-utils/lslogins.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/login-utils/lslogins.c b/login-utils/lslogins.c
index e2a0d43..280768e 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;
--
1.8.3.1