diff options
author | Campbell Barton <campbell@blender.org> | 2022-10-30 07:56:28 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-10-30 07:56:28 +0300 |
commit | 9bd38750b39637f5b52ac64944af5b6113c30c03 (patch) | |
tree | 3a34ab9b3107fdd3e08b7279c1219a21fa326abc /source/blender/sequencer | |
parent | 5392f220f024b59d199dfc40ef4817401f22ee2b (diff) |
Cleanup: replace BLI string copy & append with BLI_path_join(..)
Copying and appending is unnecessarily verbose with each call having to
pass in the buffer size.
Diffstat (limited to 'source/blender/sequencer')
-rw-r--r-- | source/blender/sequencer/intern/disk_cache.c | 12 | ||||
-rw-r--r-- | source/blender/sequencer/intern/proxy.c | 3 |
2 files changed, 6 insertions, 9 deletions
diff --git a/source/blender/sequencer/intern/disk_cache.c b/source/blender/sequencer/intern/disk_cache.c index 8c0ae4e055c..596a28201cc 100644 --- a/source/blender/sequencer/intern/disk_cache.c +++ b/source/blender/sequencer/intern/disk_cache.c @@ -291,8 +291,8 @@ static void seq_disk_cache_get_project_dir(SeqDiskCache *disk_cache, char *path, /* Use suffix, so that the cache directory name does not conflict with the bmain's blend file. */ const char *suffix = "_seq_cache"; strncat(cache_dir, suffix, sizeof(cache_dir) - strlen(cache_dir) - 1); - BLI_strncpy(path, seq_disk_cache_base_dir(), path_len); - BLI_path_append(path, path_len, cache_dir); + + BLI_path_join(path, path_len, seq_disk_cache_base_dir(), cache_dir); } static void seq_disk_cache_get_dir( @@ -307,9 +307,8 @@ static void seq_disk_cache_get_dir( BLI_strncpy(seq_name, seq->name, sizeof(seq_name)); BLI_filename_make_safe(scene_name); BLI_filename_make_safe(seq_name); - BLI_strncpy(path, project_dir, path_len); - BLI_path_append(path, path_len, scene_name); - BLI_path_append(path, path_len, seq_name); + + BLI_path_join(path, path_len, project_dir, scene_name, seq_name); } static void seq_disk_cache_get_file_path(SeqDiskCache *disk_cache, @@ -350,8 +349,7 @@ static void seq_disk_cache_handle_versioning(SeqDiskCache *disk_cache) int version = 0; seq_disk_cache_get_project_dir(disk_cache, filepath, sizeof(filepath)); - BLI_strncpy(path_version_file, filepath, sizeof(path_version_file)); - BLI_path_append(path_version_file, sizeof(path_version_file), "cache_version"); + BLI_path_join(path_version_file, sizeof(path_version_file), filepath, "cache_version"); if (BLI_exists(filepath) && BLI_is_dir(filepath)) { FILE *file = BLI_fopen(path_version_file, "r"); diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index 9f08db2aa45..fc1df4dc3ac 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -585,8 +585,7 @@ void seq_proxy_index_dir_set(struct anim *anim, const char *base_dir) char fname[FILE_MAXFILE]; IMB_anim_get_fname(anim, fname, FILE_MAXFILE); - BLI_strncpy(dir, base_dir, sizeof(dir)); - BLI_path_append(dir, sizeof(dir), fname); + BLI_path_join(dir, sizeof(dir), base_dir, fname); IMB_anim_set_index_dir(anim, dir); } |