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/python | |
parent | f35289574ac8a6c96fb82652a99509406ac2368e (diff) |
added checks for zero length strings when checking for the last character
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/api2_2x/Sys.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Sys.c b/source/blender/python/api2_2x/Sys.c index b0d18f9f4aa..baae2220143 100644 --- a/source/blender/python/api2_2x/Sys.c +++ b/source/blender/python/api2_2x/Sys.c @@ -411,7 +411,7 @@ static PyObject *M_sys_cleanpath( PyObject * self, PyObject * value ) return EXPP_ReturnPyObjError( PyExc_TypeError, "expected string argument" ); last = strlen(path)-1; - if ((path[last]=='/') || (path[last]=='\\')) { + if ((last >= 0) && ((path[last]=='/') || (path[last]=='\\'))) { trailing_slash = 1; } BLI_strncpy(cleaned, path, FILE_MAXDIR + FILE_MAXFILE); |