diff options
Diffstat (limited to 'source/blender/blenlib/intern/path_util.c')
-rw-r--r-- | source/blender/blenlib/intern/path_util.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 9be0690d95a..4cbd93ce0a1 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -418,8 +418,8 @@ void BLI_path_rel(char *file, const char *relfile) /* also bail out if relative path is not set */ if (relfile[0] == 0) return; -#ifdef WIN32 - if (strlen(relfile) > 2 && relfile[1] != ':') { +#ifdef WIN32 + if (BLI_strnlen(relfile, 3) > 2 && relfile[1] != ':') { char* ptemp; /* fix missing volume name in relative base, can happen with old recent-files.txt files */ @@ -433,7 +433,7 @@ void BLI_path_rel(char *file, const char *relfile) BLI_strncpy(temp, relfile, FILE_MAXDIR + FILE_MAXFILE); } - if (strlen(file) > 2) { + if (BLI_strnlen(file, 3) > 2) { if ( temp[1] == ':' && file[1] == ':' && temp[0] != file[0] ) return; } @@ -1181,8 +1181,9 @@ void BLI_setenv_if_new(const char *env, const char* val) void BLI_clean(char *path) { if(path==0) return; + #ifdef WIN32 - if(path && strlen(path)>2) { + if(path && BLI_strnlen(path, 3) > 2) { BLI_char_switch(path+2, '/', '\\'); } #else @@ -1271,7 +1272,7 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir, } #ifdef WIN32 else { - if (strlen(dir) >= 2 && dir[1] == ':' ) { + if (BLI_strnlen(dir, 3) >= 2 && dir[1] == ':' ) { BLI_strncpy(string, dir, 3); dir += 2; } |