]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/sgetspent.c: sgetspent(): Explicitly use an empty string literal
authorAlejandro Colomar <alx@kernel.org>
Mon, 15 Jan 2024 17:23:17 +0000 (18:23 +0100)
committerSerge Hallyn <serge@hallyn.com>
Thu, 14 Mar 2024 22:11:36 +0000 (17:11 -0500)
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>
lib/sgetspent.c

index 0ac1edd61af592f30fabcc26bed490c8edeaacee..758258f90cad8ae0b2e2f74a2c05afcf5ef77fc8 100644 (file)
@@ -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)) ) {