diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-12 03:10:54 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-12 04:02:25 +0300 |
commit | f884a34cae6323327b181ebaa217758cc938fd29 (patch) | |
tree | 85f8749718461d6292c5c9b25c2ef6408d3850f8 /source/blender/blenkernel/intern/image_save.cc | |
parent | cf9c0a4b506e85a4158ec68413c60e8af1de4a0a (diff) |
Cleanup: replace BLI_snprintf with BLI_path_join
Also use a larger buffer to account for the unlikely case of the
buffer not being big enough for the appended directories.
Diffstat (limited to 'source/blender/blenkernel/intern/image_save.cc')
-rw-r--r-- | source/blender/blenkernel/intern/image_save.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index e65a94d5301..6f62ee123cb 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -175,12 +175,12 @@ bool BKE_image_save_options_init(ImageSaveOptions *opts, BLI_strncpy(opts->filepath, G.ima, sizeof(opts->filepath)); } else { - BLI_snprintf(opts->filepath, sizeof(opts->filepath), "//%s", DATA_("untitled")); + BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", DATA_("untitled"), nullptr); BLI_path_abs(opts->filepath, BKE_main_blendfile_path(bmain)); } } else { - BLI_snprintf(opts->filepath, sizeof(opts->filepath), "//%s", ima->id.name + 2); + BLI_path_join(opts->filepath, sizeof(opts->filepath), "//", ima->id.name + 2, nullptr); BLI_path_make_safe(opts->filepath); BLI_path_abs(opts->filepath, is_prev_save ? G.ima : BKE_main_blendfile_path(bmain)); } |