summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/ttyname.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index 56e7ce1..013796c 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -85,7 +85,7 @@ ttyname_r(int fd, char *buf, size_t len)
if (!_ioctl(fd, FIODGNAME, &fgn))
return (0);
devname_r(sb.st_rdev, S_IFCHR,
- buf + strlen(buf), sizeof(buf) - strlen(buf));
+ buf + strlen(buf), len - strlen(buf));
return (0);
}
OpenPOWER on IntegriCloud