diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-10-11 01:36:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-10-11 01:36:43 +0300 |
commit | b618c185cb7c5930980e459c84b8818a0fba1f1d (patch) | |
tree | 0776507269a3f11932ff637c644f4babac62d749 /source/blender/blenlib/intern/path_util.c | |
parent | 2083a7e274fefd4c82c8c52df87bc175e453c628 (diff) |
Fix incorrect strncpy use
Didn't ensure null terminated.
Diffstat (limited to 'source/blender/blenlib/intern/path_util.c')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 10ca0fa6cbf..84c932db1c7 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -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); |