# some fixes to reduce the size of the binary. Total savings are ~3%. Thanks to Krishty for his efforts in that regard.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@939 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
+18
-16
@@ -159,47 +159,49 @@ Logger *DefaultLogger::create(const char* name /*= "AssimpLog.txt"*/,
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::debug(const std::string &message) {
|
||||
void Logger::debug(const char* message) {
|
||||
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns ...
|
||||
if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns since
|
||||
// sometimes importers will include data from the input file
|
||||
// (i.e. node names) in their messages.
|
||||
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
|
||||
ai_assert(false);
|
||||
return;
|
||||
}
|
||||
return OnDebug(message.c_str());
|
||||
return OnDebug(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::info(const std::string &message) {
|
||||
void Logger::info(const char* message) {
|
||||
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns ...
|
||||
if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
|
||||
// SECURITY FIX: see above
|
||||
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
|
||||
ai_assert(false);
|
||||
return;
|
||||
}
|
||||
return OnInfo(message.c_str());
|
||||
return OnInfo(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::warn(const std::string &message) {
|
||||
void Logger::warn(const char* message) {
|
||||
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns ...
|
||||
if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
|
||||
// SECURITY FIX: see above
|
||||
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
|
||||
ai_assert(false);
|
||||
return;
|
||||
}
|
||||
return OnWarn(message.c_str());
|
||||
return OnWarn(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
void Logger::error(const std::string &message) {
|
||||
void Logger::error(const char* message) {
|
||||
|
||||
// SECURITY FIX: otherwise it's easy to produce overruns ...
|
||||
if (message.length()>MAX_LOG_MESSAGE_LENGTH) {
|
||||
// SECURITY FIX: see above
|
||||
if (strlen(message)>MAX_LOG_MESSAGE_LENGTH) {
|
||||
ai_assert(false);
|
||||
return;
|
||||
}
|
||||
return OnError(message.c_str());
|
||||
return OnError(message);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user