-added another mutex release to fix a bug found from a segfault

-added a safer debug buffer output method
-added ability to specify precsion for floating point conversion
This commit is contained in:
Mark Vejvoda
2010-06-05 15:48:50 +00:00
parent 50ca413310
commit 1d0836f0ba
7 changed files with 155 additions and 16 deletions

View File

@@ -195,8 +195,9 @@ void SystemFlags::handleDebug(DebugType type, const char *fmt, ...) {
va_list argList;
va_start(argList, fmt);
char szBuf[4096]="";
vsprintf(szBuf,fmt, argList);
const int max_debug_buffer_size = 8096;
char szBuf[max_debug_buffer_size]="";
vsnprintf(szBuf,max_debug_buffer_size-1,fmt, argList);
// Either output to a logfile or
if(currentDebugLog.debugLogFileName != "") {