summaryrefslogtreecommitdiff
path: root/libc/termios/ttyname.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-06-13 22:10:41 +0000
committerEric Andersen <andersen@codepoet.org>2001-06-13 22:10:41 +0000
commit311b479b519b33774b6bb75d5c4961f2e2498fc2 (patch)
treebc24a517ae40984749c714d712bbd3fe557ca54b /libc/termios/ttyname.c
parent0920bb759689e92a25bd5d690617cdbc0cd4cd79 (diff)
Fix a really stupid bug with ttyname, thanks to a patch from
Stefan Soucek <ssoucek@coactive.com>
Diffstat (limited to 'libc/termios/ttyname.c')
-rw-r--r--libc/termios/ttyname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/termios/ttyname.c b/libc/termios/ttyname.c
index f7f066e61..e6c28adc2 100644
--- a/libc/termios/ttyname.c
+++ b/libc/termios/ttyname.c
@@ -18,7 +18,7 @@ static char * __check_dir_for_tty_match(char * dirname, struct stat *st)
strcat(name, "/");
while ((d = readdir(fp)) != 0) {
- strcpy(name + sizeof(dirname), d->d_name);
+ strcpy(name + strlen(dirname) + 1, d->d_name);
if (stat(name, &dst) == 0
&& st->st_dev == dst.st_dev && st->st_ino == dst.st_ino) {
closedir(fp);