aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/src/main/jni/com_google_ase_Exec.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/src/main/jni/com_google_ase_Exec.cpp b/app/src/main/jni/com_google_ase_Exec.cpp
index b78f356..b2fa39f 100644
--- a/app/src/main/jni/com_google_ase_Exec.cpp
+++ b/app/src/main/jni/com_google_ase_Exec.cpp
@@ -79,7 +79,7 @@ int jniGetFDFromFileDescriptor(JNIEnv* env, jobject fileDescriptor) {
static int create_subprocess(
const char* cmd, const char* arg0, const char* arg1, int* pProcessId) {
- char* devname;
+ char devname[32];
int ptm;
pid_t pid;
@@ -91,7 +91,7 @@ static int create_subprocess(
fcntl(ptm, F_SETFD, FD_CLOEXEC);
if(grantpt(ptm) || unlockpt(ptm) ||
- ((devname = (char*) ptsname(ptm)) == 0)){
+ ptsname_r(ptm, devname, sizeof(devname))){
LOG("[ trouble with /dev/ptmx - %s ]\n", strerror(errno));
return -1;
}