aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2007-11-21 16:25:00 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2007-11-21 16:25:00 +0000
commit6bde64f285de069c1c2ea7235b0399884803c765 (patch)
tree9fa61cb9ea8e333a627072863ea051492fa85abb /usr.bin
parentb6292775b7923782946398ec26439823abbd2418 (diff)
Notes
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/write/write.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/write/write.c b/usr.bin/write/write.c
index b0e0a1f91b8d..878c8c1d0ba1 100644
--- a/usr.bin/write/write.c
+++ b/usr.bin/write/write.c
@@ -76,7 +76,6 @@ int utmp_chk(char *, char *);
int
main(int argc, char **argv)
{
- char *cp;
time_t atime;
uid_t myuid;
int msgsok, myttyfd;
@@ -100,8 +99,8 @@ main(int argc, char **argv)
errx(1, "can't find your tty");
if (!(mytty = ttyname(myttyfd)))
errx(1, "can't find your tty's name");
- if ((cp = rindex(mytty, '/')))
- mytty = cp + 1;
+ if (!strncmp(mytty, _PATH_DEV, strlen(_PATH_DEV)))
+ mytty += strlen(_PATH_DEV);
if (term_chk(mytty, &msgsok, &atime, 1))
exit(1);
if (!msgsok)