diff --git a/lib/fields.c b/lib/fields.c index ada6726e7..5900395ef 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -43,7 +43,7 @@ int valid_field (const char *field, const char *illegal) /* For each character of field, search if it appears in the list * of illegal characters. */ - if (illegal && NULL != strpbrk (field, illegal)) { + if (illegal && strpbrk(field, illegal)) { return -1; } diff --git a/lib/setupenv.c b/lib/setupenv.c index 63f7fb95d..28754b5d5 100644 --- a/lib/setupenv.c +++ b/lib/setupenv.c @@ -72,7 +72,7 @@ static void read_env_file (const char *filename) val = stpsep(cp, "="); if (val == NULL) continue; - if (strpbrk(name, " \t") != NULL) + if (strpbrk(name, " \t")) continue; #if 0 /* XXX untested, and needs rewrite with fewer goto's :-) */ /* diff --git a/src/useradd.c b/src/useradd.c index 562ba44fc..e6cce57d5 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -109,7 +109,7 @@ static const char *def_log_init = "yes"; static long def_inactive = -1; static const char *def_expire = ""; -#define VALID(s) (strcspn (s, ":\n") == strlen (s)) +#define VALID(s) (!strpbrk(s, ":\n")) static const char *user_name = ""; static const char *user_pass = "!"; diff --git a/src/usermod.c b/src/usermod.c index 7ea1a7244..49159d60f 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -93,7 +93,7 @@ #define E_SUB_GID_UPDATE 18 /* can't update the subordinate gid file */ #endif /* ENABLE_SUBIDS */ -#define VALID(s) (strcspn (s, ":\n") == strlen (s)) +#define VALID(s) (!strpbrk(s, ":\n")) /* * Global variables