diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-17 03:16:41 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-17 03:16:41 +0300 |
commit | 1d1cade9a9a7f75034669520e39c56959917803a (patch) | |
tree | 92482d85f4199f1f65ebcb4b04b6c2cf4a4a0ea4 /source/blender/io/common | |
parent | 2f3f208901b5bf0fde7fbc9c3f02b66f7591b169 (diff) |
BLI_path: remove trailing NULL argument to BLI_path_join
Using varargs had the disadvantages, replace with a macro which has
some advantages.
- Arguments are type checked.
- Less verbose.
- Unintended NULL arguments would silently terminate joining paths.
- Passing in a NULL argument warns with GCC.
Diffstat (limited to 'source/blender/io/common')
-rw-r--r-- | source/blender/io/common/intern/path_util.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/io/common/intern/path_util.cc b/source/blender/io/common/intern/path_util.cc index 18632b410f8..63ff6cf29ee 100644 --- a/source/blender/io/common/intern/path_util.cc +++ b/source/blender/io/common/intern/path_util.cc @@ -28,8 +28,7 @@ std::string path_reference(StringRefNull filepath, } else if (mode == PATH_REFERENCE_COPY) { char filepath_cpy[PATH_MAX]; - BLI_path_join( - filepath_cpy, PATH_MAX, base_dst.c_str(), BLI_path_basename(filepath_abs), nullptr); + BLI_path_join(filepath_cpy, PATH_MAX, base_dst.c_str(), BLI_path_basename(filepath_abs)); copy_set->add(std::make_pair(filepath_abs, filepath_cpy)); BLI_strncpy(filepath_abs, filepath_cpy, PATH_MAX); mode = PATH_REFERENCE_RELATIVE; |