projects
/
platform
/
upstream
/
assimp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6673c3
)
Fix assimp/assimp/issues/737: use snprintf instead of sprintf.
author
Kim Kulling
<kim.kulling@googlemail.com>
Sat, 2 Jan 2016 20:29:46 +0000
(21:29 +0100)
committer
Kim Kulling
<kim.kulling@googlemail.com>
Sat, 2 Jan 2016 20:29:46 +0000
(21:29 +0100)
code/DefaultLogger.cpp
patch
|
blob
|
history
diff --git
a/code/DefaultLogger.cpp
b/code/DefaultLogger.cpp
index
8fced2d
..
a1638d0
100644
(file)
--- a/
code/DefaultLogger.cpp
+++ b/
code/DefaultLogger.cpp
@@
-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 );
}