Fix incorrect strncpy use

Didn't ensure null terminated.
This commit is contained in:
Campbell Barton
2018-10-11 09:36:43 +11:00
parent 2083a7e274
commit b618c185cb

View File

@@ -1160,12 +1160,12 @@ bool BLI_path_program_search(
do {
temp = strchr(path, separator);
if (temp) {
strncpy(filename, path, temp - path);
memcpy(filename, path, temp - path);
filename[temp - path] = 0;
path = temp + 1;
}
else {
strncpy(filename, path, sizeof(filename));
BLI_strncpy(filename, path, sizeof(filename));
}
BLI_path_append(filename, maxlen, name);