diff options
Diffstat (limited to 'lib/libc/gen/ttyslot.c')
-rw-r--r-- | lib/libc/gen/ttyslot.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/ttyslot.c b/lib/libc/gen/ttyslot.c index 066f2f9..2f72ebb 100644 --- a/lib/libc/gen/ttyslot.c +++ b/lib/libc/gen/ttyslot.c @@ -51,12 +51,12 @@ ttyslot() setttyent(); for (cnt = 0; cnt < 3; ++cnt) - if (name = ttyname(cnt)) { - if (p = rindex(name, '/')) + if ( (name = ttyname(cnt)) ) { + 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); |