From: Alejandro Colomar Date: Wed, 11 Dec 2024 20:04:52 +0000 (+0100) Subject: lib/fields.c: valid_field(): Remove useless check X-Git-Tag: 4.18.0-rc1~37 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a024449f9fd9f909c8ebe5a2b3019a1b90d4dd1;p=thirdparty%2Fshadow.git lib/fields.c: valid_field(): Remove useless check 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 --- diff --git a/lib/fields.c b/lib/fields.c index d30ed698a..818d1c593 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -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++) {