closes https://github.com/assimp/assimp/issues/1386: fix undefined behaviour in compare function.
parent
8ecf3789d7
commit
c7ea536351
|
@ -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]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue