Merge branch 'master' of github.com:assimp/assimp

pull/21/head
Alexander Gessler 2013-03-27 13:53:22 +01:00
commit 9379e63636
1 changed files with 6 additions and 3 deletions

View File

@ -1445,13 +1445,16 @@ void ColladaLoader::ConvertPath (aiString& ss)
ss.data[ss.length] = 0; ss.data[ss.length] = 0;
} }
// find and convert all %xyz special chars // find and convert all %xy special chars
char* out = ss.data; char* out = ss.data;
for( const char* it = ss.data; it != ss.data + ss.length; /**/ ) for( const char* it = ss.data; it != ss.data + ss.length; /**/ )
{ {
if( *it == '%' ) if( *it == '%' && (it + 3) < ss.data + ss.length )
{ {
size_t nbr = strtoul16( ++it, &it); // separate the number to avoid dragging in chars from behind into the parsing
char mychar[3] = { it[1], it[2], 0 };
size_t nbr = strtoul16( mychar);
it += 3;
*out++ = (char)(nbr & 0xFF); *out++ = (char)(nbr & 0xFF);
} else } else
{ {