if (!strprefix(*cur, *bad)) {
continue;
}
- if (strchr (*cur, '/') == NULL) {
+ if (!strchr(*cur, '/'))
continue; /* OK */
- }
+
for (move = cur; NULL != *move; move++) {
*move = *(move + 1);
}
#include <ctype.h>
#include <stdio.h>
+#include <string.h>
#include "attr.h"
#include "prototypes.h"
}
for (i = j = 0; ('\0' != new[i]) && ('\0' != old[i]); i++) {
- if (strchr (new, old[i]) != NULL) {
+ if (strchr(new, old[i]))
j++;
- }
}
if (i >= j * 2) {
if (NULL == cp) {
/* not specified, use a minimal default */
addenv ((info->pw_uid == 0) ? "PATH=/sbin:/bin:/usr/sbin:/usr/bin" : "PATH=/bin:/usr/bin", NULL);
- } else if (strchr (cp, '=')) {
+ } else if (strchr(cp, '=')) {
/* specified as name=value (PATH=...) */
addenv (cp, NULL);
} else {
shadow_progname, TCB_DIR, strerror (errno));
goto out_free_path;
}
- while ((ind = strchr (ptr, '/'))) {
+ while (NULL != (ind = strchr(ptr, '/'))) {
stpcpy(ind, "");
dir = aprintf(TCB_DIR "/%s", path);
if (dir == NULL) {
#include <pwd.h>
#include <signal.h>
#include <stdio.h>
+#include <string.h>
#include <sys/types.h>
#include <getopt.h>
cp = "frwh";
}
- if (strchr (cp, field) != NULL) {
+ if (strchr(cp, field))
return true;
- }
return false;
}
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef USE_PAM
#include "pam_defs.h"
if (feof (stdin) == 0) {
// Drop all remaining characters on this line.
while (fgets (buf, sizeof buf, stdin) != NULL) {
- cp = strchr (buf, '\n');
- if (cp != NULL) {
+ if (strchr(buf, '\n'))
break;
- }
}
fprintf (stderr,
return true;
}
} else if (strcaseeq(tok, "LOCAL")) { /* LOCAL: no dots */
- if (strchr (string, '.') == NULL) {
+ if (!strchr(string, '.'))
return true;
- }
} else if ( (!streq(tok, "") && tok[strlen(tok) - 1] == '.') /* network */
&& strprefix(resolve_hostname(string), tok)) {
return true;
cp = getdef_str ((pw->pw_uid == 0) ? "ENV_SUPATH" : "ENV_PATH");
if (NULL == cp) {
addenv ((pw->pw_uid == 0) ? "PATH=/sbin:/bin:/usr/sbin:/usr/bin" : "PATH=/bin:/usr/bin", NULL);
- } else if (strchr (cp, '=') != NULL) {
+ } else if (strchr(cp, '=')) {
addenv (cp, NULL);
} else {
addenv ("PATH", cp);