Fixed WLog_PrintMessagePrefixVA
WLog_PrintMessagePrefixVA is called with format being a stack variable. Always copy the data to message->PrefixString otherwise the information will be lost whenever the stack is destroyed.
This commit is contained in:
parent
88b6ff00d9
commit
b574e196d9
@ -45,19 +45,15 @@ extern const char* WLOG_LEVELS[7];
|
||||
* Log Layout
|
||||
*/
|
||||
|
||||
void WLog_PrintMessagePrefixVA(wLog* log, wLogMessage* message, const char* format, va_list args)
|
||||
static void WLog_PrintMessagePrefixVA(wLog* log, wLogMessage* message, const char* format, va_list args)
|
||||
{
|
||||
if (!strchr(format, '%'))
|
||||
{
|
||||
message->PrefixString = (LPSTR) format;
|
||||
}
|
||||
sprintf_s(message->PrefixString, WLOG_MAX_PREFIX_SIZE - 1, format);
|
||||
else
|
||||
{
|
||||
wvsnprintfx(message->PrefixString, WLOG_MAX_PREFIX_SIZE - 1, format, args);
|
||||
}
|
||||
}
|
||||
|
||||
void WLog_PrintMessagePrefix(wLog* log, wLogMessage* message, const char* format, ...)
|
||||
static void WLog_PrintMessagePrefix(wLog* log, wLogMessage* message, const char* format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
Loading…
Reference in New Issue
Block a user