]> git.saurik.com Git - apple/libc.git/blobdiff - util/pty.c
Libc-1272.250.1.tar.gz
[apple/libc.git] / util / pty.c
index f6a72e1f6cadd9561b2499ee7dcd5d5ec5f5903b..1b7a3bd87ac148afa96fbfbf3e8fd1904e91f57d 100644 (file)
@@ -76,12 +76,12 @@ int openpty(amaster, aslave, name, termp, winp)
        struct winsize *winp;
 {
        int master, slave;
-       char *sname;
+       char sname[128];
 
        if ((master = posix_openpt(O_RDWR|O_NOCTTY)) < 0)
                return -1;
        if (grantpt(master) < 0 || unlockpt(master) < 0
-           || (sname = ptsname(master)) == NULL
+           || ptsname_r(master, sname, sizeof(sname)) == -1
            || (slave = open(sname, O_RDWR|O_NOCTTY, 0)) < 0) {
                (void) close(master);
                return -1;