Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-10-08 07:05:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-08 07:05:58 +0300
commita5e631171bdcdb12f508528f391d3916014e23e8 (patch)
tree79cc6bb9d4d0c1425ac53d12496ebcba96c5ec21 /source/creator
parente47177e301d104a8b7110e4490bf587c86835bad (diff)
BLI_path api, minor changes to CWD handling
- BLI_current_working_dir's return value must be checked, since it may fail. - BLI_current_working_dir now behaves like getcwd, where a too-small target will return failure. - avoid buffer overrun with BLI_path_cwd, by taking a maxlen arg.
Diffstat (limited to 'source/creator')
-rw-r--r--source/creator/creator.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/creator/creator.c b/source/creator/creator.c
index 86922c38ba0..517dcb1074f 100644
--- a/source/creator/creator.c
+++ b/source/creator/creator.c
@@ -1246,7 +1246,7 @@ static int run_python_file(int argc, const char **argv, void *data)
/* Make the path absolute because its needed for relative linked blends to be found */
char filename[FILE_MAX];
BLI_strncpy(filename, argv[1], sizeof(filename));
- BLI_path_cwd(filename);
+ BLI_path_cwd(filename, sizeof(filename));
BPY_CTX_SETUP(BPY_filepath_exec(C, filename, NULL));
@@ -1371,7 +1371,7 @@ static int load_file(int UNUSED(argc), const char **argv, void *data)
}
BLI_strncpy(filename, argv[0], sizeof(filename));
- BLI_path_cwd(filename);
+ BLI_path_cwd(filename, sizeof(filename));
if (G.background) {
Main *bmain;