Checking a boolean (actually, a boolean-like pointer) is more readable
than comparing against a length.
This removes the only uses of strcspn(3) in this project.
strpbrk(3) is a simpler call, even though it has a weird name. It's
just like strchr(3) but searches for several characters. I'd have named
it strchrs().
Signed-off-by: Alejandro Colomar <alx@kernel.org>
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 = "!";
#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