closes https://github.com/assimp/assimp/issues/1386: fix undefined behaviour in compare function.

pull/1779/head
Kim Kulling 2018-02-07 20:21:05 +01:00
parent 8ecf3789d7
commit c7ea536351
1 changed files with 5 additions and 6 deletions

View File

@ -58,12 +58,11 @@ using namespace Assimp::Formatter;
static bool match4(StreamReaderAny& stream, const char* string) {
ai_assert( nullptr != string );
char tmp[] = {
(const char)(stream).GetI1(),
(const char)(stream).GetI1(),
(const char)(stream).GetI1(),
(const char)(stream).GetI1()
};
char tmp[4];
tmp[ 0 ] = ( stream ).GetI1();
tmp[ 1 ] = ( stream ).GetI1();
tmp[ 2 ] = ( stream ).GetI1();
tmp[ 3 ] = ( stream ).GetI1();
return (tmp[0]==string[0] && tmp[1]==string[1] && tmp[2]==string[2] && tmp[3]==string[3]);
}