mirror of
git://git.musl-libc.org/musl
synced 2024-12-16 03:35:06 +00:00
fix broken ttyname[_r] (failure to null-terminate result)
This commit is contained in:
parent
fb247fafa0
commit
fcfba99503
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user