Kernel/x86 - Fix PMem bitmap overflow
[tpg/acess2.git] / KernelLand / Kernel / logging.c
index aab25a1..0ae993e 100644 (file)
@@ -93,7 +93,7 @@ void Log_AddEvent(const char *Ident, int Level, const char *Format, va_list Args
        if( Level >= NUM_LOG_LEVELS )   return;
 
        va_copy(args_tmp, Args);
-       len = vsnprintf(NULL, 256, Format, args_tmp);
+       len = vsnprintf(NULL, 0, Format, args_tmp);
        
        #if USE_RING_BUFFER || !CACHE_MESSAGES
        {
@@ -163,10 +163,11 @@ void Log_Int_PrintMessage(tLogEntry *Entry)
                csaLevelColours[Entry->Level],
                Entry->Time
                );
-       LogF("%s [%-8s] %i - %s",
+       LogF("%s [%-8s] %i - %.*s",
                csaLevelCodes[Entry->Level],
                Entry->Ident,
                Threads_GetTID(),
+               Entry->Length,
                Entry->Data
                );
        LogF("\x1B[0m\r\n");    // Separate in case Entry->Data is too long

UCC git Repository :: git.ucc.asn.au