fix linux getPaths to append a null terminator on the strings

develop
belal 2010-09-23 08:33:45 -04:00
parent 026a2eb94e
commit 583f997e2f
3 changed files with 3 additions and 0 deletions

@ -929,5 +929,6 @@ string SHMProcess::getPath()
sprintf(cwd_name,"/proc/%d/cwd", getPID());
// resolve /proc/PID/exe link
target_result = readlink(cwd_name, target_name, sizeof(target_name));
target_name[target_result] = '\0';
return(string(target_name));
}

@ -633,5 +633,6 @@ string WineProcess::getPath()
sprintf(cwd_name,"/proc/%d/cwd", getPID());
// resolve /proc/PID/exe link
target_result = readlink(cwd_name, target_name, sizeof(target_name));
target_name[target_result] = '\0';
return(string(target_name));
}

@ -595,5 +595,6 @@ string NormalProcess::getPath()
sprintf(cwd_name,"/proc/%d/cwd", getPID());
// resolve /proc/PID/exe link
target_result = readlink(cwd_name, target_name, sizeof(target_name));
target_name[target_result] = '\0';
return(string(target_name));
}