projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
fb247fa
)
fix broken ttyname[_r] (failure to null-terminate result)
author
Rich Felker
<dalias@aerifal.cx>
Fri, 7 Sep 2012 00:21:13 +0000
(20:21 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 7 Sep 2012 00:21:13 +0000
(20:21 -0400)
src/unistd/ttyname_r.c
patch
|
blob
|
history
diff --git
a/src/unistd/ttyname_r.c
b/src/unistd/ttyname_r.c
index
f86fbd9
..
2255e2d
100644
(file)
--- a/
src/unistd/ttyname_r.c
+++ b/
src/unistd/ttyname_r.c
@@
-15,5
+15,8
@@
int ttyname_r(int fd, char *name, size_t size)
if (l < 0) return errno;
else if (l == size) return ERANGE;
- else return 0;
+ else {
+ name[l] = 0;
+ return 0;
+ }
}