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