diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-06-05 17:12:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-06-05 17:12:17 +0400 |
commit | 6757b759ea29f8b59d92b2772efd2d0d1dac2c8a (patch) | |
tree | 9dd84f533df3fd675a2df82ff6c06144dca6c11f /source/blender/blenlib/intern/util.c | |
parent | f35289574ac8a6c96fb82652a99509406ac2368e (diff) |
added checks for zero length strings when checking for the last character
Diffstat (limited to 'source/blender/blenlib/intern/util.c')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index ad34af05ac7..848e45ccb1b 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -1173,10 +1173,12 @@ int BLI_convertstringcode(char *path, const char *basepath) strcpy(path, tmp); } - if (path[strlen(path)-1]=='/') { - BLI_cleanup_dir(NULL, path); - } else { - BLI_cleanup_file(NULL, path); + if (path[0]!='\0') { + if ( path[strlen(path)-1]=='/') { + BLI_cleanup_dir(NULL, path); + } else { + BLI_cleanup_file(NULL, path); + } } #ifdef WIN32 |