commit | fcfba99503746e44585d7e318562dd425e8ff390 | [log] [tgz] |
---|---|---|
author | Rich Felker <dalias@aerifal.cx> | Thu Sep 06 20:21:13 2012 -0400 |
committer | Rich Felker <dalias@aerifal.cx> | Thu Sep 06 20:21:13 2012 -0400 |
tree | 9000cee083d90ae4c8f859ab0061766a5e9b9b25 | |
parent | fb247fafa04ee52dda816355ab0461132297b9a4 [diff] |
fix broken ttyname[_r] (failure to null-terminate result)
diff --git a/src/unistd/ttyname_r.c b/src/unistd/ttyname_r.c index f86fbd9..2255e2d 100644 --- a/src/unistd/ttyname_r.c +++ b/src/unistd/ttyname_r.c
@@ -15,5 +15,8 @@ if (l < 0) return errno; else if (l == size) return ERANGE; - else return 0; + else { + name[l] = 0; + return 0; + } }