changed from using a preset char buffer to string.

This commit is contained in:
Arthur Ice
2013-05-20 23:59:41 -07:00
parent c18d868d03
commit 70eb226fea
2 changed files with 23 additions and 18 deletions
+9 -6
View File
@@ -18,9 +18,12 @@
#include "debug.h"
#include "logsys.h"
#include "StringUtil.h"
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <string>
void log_message(LogType type, const char *fmt, ...) {
va_list args;
@@ -30,10 +33,10 @@ void log_message(LogType type, const char *fmt, ...) {
}
void log_messageVA(LogType type, const char *fmt, va_list args) {
char prefix_buffer[256];
snprintf(prefix_buffer, 255, "[%s] ", log_type_info[type].name);
prefix_buffer[255] = '\0';
LogFile->writePVA(EQEMuLog::Debug, prefix_buffer, fmt, args);
std::string prefix_buffer;
StringFormat(prefix_buffer, "[%s] ", log_type_info[type].name);
LogFile->writePVA(EQEMuLog::Debug, prefix_buffer.c_str(), fmt, args);
}