Apply [#26311] Collada Exporter Crash on Win64 build

Submitted by Filiciss Muhgue

Selecting COLLADA export after starting blender into default scene Blender would crash, due to misreading the path string (no file saved yet, so it was zero).
This commit is contained in:
Nathan Letwory
2011-03-08 08:33:52 +00:00
parent 092c3d8a85
commit 65da16a5c1

View File

@@ -1392,9 +1392,12 @@ int BLI_replace_extension(char *path, int maxlen, const char *ext)
{
unsigned int a;
for(a=strlen(path)-1; a>=0; a--)
if(path[a] == '.' || path[a] == '/' || path[a] == '\\')
for(a=strlen(path); a>0; a--) {
if(path[a-1] == '.' || path[a-1] == '/' || path[a-1] == '\\') {
a--;
break;
}
}
if(path[a] != '.')
a= strlen(path);