Loading...
--- Libc/Libc-1353.100.2/util/pty.c
+++ Libc/Libc-583/util/pty.c
@@ -69,6 +69,8 @@
 #include <util.h>
 #include <syslog.h>
 
+static char ptytemplate[] = "/dev/ptyXX";
+
 int openpty(amaster, aslave, name, termp, winp)
 	int *amaster, *aslave;
 	char *name;
@@ -76,12 +78,12 @@
 	struct winsize *winp;
 {
 	int master, slave;
-	char sname[128];
+	char *sname;
 
 	if ((master = posix_openpt(O_RDWR|O_NOCTTY)) < 0)
 		return -1;
 	if (grantpt(master) < 0 || unlockpt(master) < 0
-	    || ptsname_r(master, sname, sizeof(sname)) == -1
+	    || (sname = ptsname(master)) == NULL
 	    || (slave = open(sname, O_RDWR|O_NOCTTY, 0)) < 0) {
 		(void) close(master);
 		return -1;