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;
+	}
 }