From 311b479b519b33774b6bb75d5c4961f2e2498fc2 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 13 Jun 2001 22:10:41 +0000 Subject: Fix a really stupid bug with ttyname, thanks to a patch from Stefan Soucek --- libc/termios/ttyname.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libc') 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); -- cgit v1.2.3