diff --git a/lib/nss.c b/lib/nss.c index b902e5d7..503f97e6 100644 --- a/lib/nss.c +++ b/lib/nss.c @@ -70,14 +70,14 @@ void nss_init(const char *nsswitch_path) { return; } while ((getline(&line, &len, nssfp)) != -1) { - if (line[0] == '\0' || line[0] == '#') + if (line[0] == '#') continue; if (strlen(line) < 8) continue; if (strncasecmp(line, "subid:", 6) != 0) continue; p = &line[6]; - while ((*p) && isspace(*p)) + while (isspace(*p)) p++; if (*p != '\0') break; diff --git a/lib/port.c b/lib/port.c index 3068ae9d..8a45b67e 100644 --- a/lib/port.c +++ b/lib/port.c @@ -243,9 +243,7 @@ static struct port *getportent (void) * week or the other two values. */ - for (i = 0; - ('\0' != cp[i]) && ('\0' != cp[i + 1]) && isalpha (cp[i]); - i += 2) { + for (i = 0; isalpha(cp[i]) && ('\0' != cp[i + 1]); i += 2) { switch ((cp[i] << 8) | (cp[i + 1])) { case ('S' << 8) | 'u': port.pt_times[j].t_days |= 01; @@ -294,7 +292,7 @@ static struct port *getportent (void) * representing the times of day. */ - for (dtime = 0; ('\0' != cp[i]) && isdigit (cp[i]); i++) { + for (dtime = 0; isdigit (cp[i]); i++) { dtime = dtime * 10 + cp[i] - '0'; } @@ -304,9 +302,7 @@ static struct port *getportent (void) port.pt_times[j].t_start = dtime; cp = cp + i + 1; - for (dtime = 0, i = 0; - ('\0' != cp[i]) && isdigit (cp[i]); - i++) { + for (dtime = 0, i = 0; isdigit (cp[i]); i++) { dtime = dtime * 10 + cp[i] - '0'; } diff --git a/libmisc/setupenv.c b/libmisc/setupenv.c index b30dae34..b082fe0e 100644 --- a/libmisc/setupenv.c +++ b/libmisc/setupenv.c @@ -63,7 +63,7 @@ static void read_env_file (const char *filename) cp = buf; /* ignore whitespace and comments */ - while (('\0' != *cp) && isspace (*cp)) { + while (isspace (*cp)) { cp++; } if (('\0' == *cp) || ('#' == *cp)) {