diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-08-12 07:37:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-08-12 07:37:45 +0400 |
commit | 6827ac7e0dfe5e6489d0d30fa2b860b2a862b0f6 (patch) | |
tree | e3656b1441aaed239788b8b60f7dc0710533e6f1 /source/blender/blenlib | |
parent | ffd65f49da5acba20e84e5a82b4c64a5425e5def (diff) |
bugfix [#23263] Changing view crashes blender
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 260f59aa03c..cf773d575e5 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -586,7 +586,7 @@ int BLI_path_abs(char *path, const char *basepath) BLI_strncpy(tmp, path, FILE_MAX); } #else - BLI_strncpy(tmp, path, FILE_MAX); + BLI_strncpy(tmp, path, sizeof(tmp)); /* Check for loading a windows path on a posix system * in this case, there is no use in trying C:/ since it @@ -603,7 +603,7 @@ int BLI_path_abs(char *path, const char *basepath) #endif - BLI_strncpy(base, basepath, FILE_MAX); + BLI_strncpy(base, basepath, sizeof(base)); BLI_cleanup_file(NULL, base); @@ -626,13 +626,13 @@ int BLI_path_abs(char *path, const char *basepath) BLI_strncpy(path, tmp+2, FILE_MAX); memcpy(tmp, base, baselen); - strcpy(tmp+baselen, path); - strcpy(path, tmp); + BLI_strncpy(tmp+baselen, path, sizeof(tmp)-baselen); + BLI_strncpy(path, tmp, FILE_MAX); } else { - strcpy(path, tmp+2); + BLI_strncpy(path, tmp+2, FILE_MAX); } } else { - strcpy(path, tmp); + BLI_strncpy(path, tmp, FILE_MAX); } if (path[0]!='\0') { @@ -1162,7 +1162,7 @@ void BLI_make_existing_file(char *name) { char di[FILE_MAXDIR+FILE_MAXFILE], fi[FILE_MAXFILE]; - strcpy(di, name); + BLI_strncpy(di, name, sizeof(di)); BLI_splitdirstring(di, fi); /* test exist */ |