summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Colomar <alx@kernel.org>2024-01-15 18:23:17 +0100
committerSerge Hallyn <serge@hallyn.com>2024-03-14 17:11:36 -0500
commit34b113baba1010753f654d9a7ea6c7e36e9edeb6 (patch)
tree33af3be02e51a3b6611b7b1912fca73e6829b897
parent93151689c0d81b3428572d411e551fff7330db07 (diff)
lib/sgetspent.c: sgetspent(): Explicitly use an empty string literal
cp can only be an empty string literal in that conditional. Use a string literal to be more explicit. Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--lib/sgetspent.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sgetspent.c b/lib/sgetspent.c
index 0ac1edd6..758258f9 100644
--- a/lib/sgetspent.c
+++ b/lib/sgetspent.c
@@ -73,9 +73,8 @@ sgetspent(const char *string)
}
}
- if (i == (FIELDS - 1)) {
- fields[i++] = cp;
- }
+ if (i == (FIELDS - 1))
+ fields[i++] = "";
if ( ((NULL != cp) && ('\0' != *cp)) ||
((i != FIELDS) && (i != OFIELDS)) ) {