diff options
Diffstat (limited to 'misc')
-rw-r--r-- | misc/getttyent.c | 6 | ||||
-rw-r--r-- | misc/mntent_r.c | 9 | ||||
-rw-r--r-- | misc/ttyslot.c | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/misc/getttyent.c b/misc/getttyent.c index dc4b9fadcb..f73cb79cda 100644 --- a/misc/getttyent.c +++ b/misc/getttyent.c @@ -55,7 +55,7 @@ getttynam(tty) register struct ttyent *t; setttyent(); - while (t = getttyent()) + while ((t = getttyent())) if (!strcmp(tty, t->ty_name)) break; endttyent(); @@ -131,7 +131,7 @@ getttyent() tty.ty_comment = p; if (*p == 0) tty.ty_comment = 0; - if (p = index(p, '\n')) + if ((p = index(p, '\n'))) *p = '\0'; return (&tty); } @@ -193,7 +193,7 @@ setttyent() if (tf) { (void)rewind(tf); return (1); - } else if (tf = fopen(_PATH_TTYS, "r")) + } else if ((tf = fopen(_PATH_TTYS, "r"))) return (1); return (0); } diff --git a/misc/mntent_r.c b/misc/mntent_r.c index 0ee74e5d9b..f6ee1ca64e 100644 --- a/misc/mntent_r.c +++ b/misc/mntent_r.c @@ -137,10 +137,11 @@ __hasmntopt (const struct mntent *mnt, const char *opt) while ((p = strstr (rest, opt)) != NULL) { - if (p == rest || p[-1] == ',' && - (p[optlen] == '\0' || - p[optlen] == '=' || - p[optlen] == ',')) + if (p == rest + || (p[-1] == ',' + && (p[optlen] == '\0' || + p[optlen] == '=' || + p[optlen] == ','))) return p; rest = strchr (rest, ','); diff --git a/misc/ttyslot.c b/misc/ttyslot.c index 430f9c02d0..7dc9b27c0c 100644 --- a/misc/ttyslot.c +++ b/misc/ttyslot.c @@ -60,11 +60,11 @@ ttyslot() setttyent(); for (cnt = 0; cnt < 3; ++cnt) if (__ttyname_r (cnt, name, buflen) == 0) { - if (p = rindex(name, '/')) + if ((p = rindex(name, '/'))) ++p; else p = name; - for (slot = 1; ttyp = getttyent(); ++slot) + for (slot = 1; (ttyp = getttyent()); ++slot) if (!strcmp(ttyp->ty_name, p)) { endttyent(); return(slot); |