]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/fields.c: valid_field(): Remove useless check
authorAlejandro Colomar <alx@kernel.org>
Wed, 11 Dec 2024 20:04:52 +0000 (21:04 +0100)
committerSerge Hallyn <serge@hallyn.com>
Tue, 3 Jun 2025 14:04:01 +0000 (09:04 -0500)
We only call this function with a string literal, and it makes little
sense to pass something else.  Let's simplify.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/fields.c

index d30ed698ab76fa0ef7757e7cb4e38986315d4ac1..818d1c593b84280f12d47634748638354b181110 100644 (file)
@@ -42,11 +42,8 @@ valid_field_(const char *field, const char *illegal)
                return -1;
        }
 
-       /* For each character of field, search if it appears in the list
-        * of illegal characters. */
-       if (illegal && strpbrk(field, illegal)) {
+       if (strpbrk(field, illegal))
                return -1;
-       }
 
        /* Search if there are non-printable or control characters */
        for (cp = field; !streq(cp, ""); cp++) {