Fix assimp/assimp/issues/737: use snprintf instead of sprintf.

pull/749/head
Kim Kulling 2016-01-02 21:29:46 +01:00
parent b6673c3fca
commit 540c9f3e9f
1 changed files with 3 additions and 2 deletions

View File

@ -283,8 +283,9 @@ void DefaultLogger::OnWarn( const char* message )
// Logs an error
void DefaultLogger::OnError( const char* message )
{
char msg[MAX_LOG_MESSAGE_LENGTH + 16];
::sprintf(msg,"Error, T%u: %s", GetThreadID(), message );
static const size_t Size = MAX_LOG_MESSAGE_LENGTH + 16;
char msg[ Size ];
::snprintf(msg, Size-1, "Error, T%u: %s", GetThreadID(), message );
WriteToStreams( msg, Logger::Err );
}