From 16e18817e909f019628cbdf3a2b55204eaee03d2 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Thu, 16 Jul 2015 21:31:21 +0200 Subject: [PATCH] Windows: Fixed wrong debugger output if logging empty string as info or warning. --- src/SDL_log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SDL_log.c b/src/SDL_log.c index 0261f12e2dc66..b5ab601e99b78 100644 --- a/src/SDL_log.c +++ b/src/SDL_log.c @@ -371,9 +371,9 @@ SDL_LogOutput(void *userdata, int category, SDL_LogPriority priority, if (consoleAttached == 1) { if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) { OutputDebugString(TEXT("Error calling WriteConsole\r\n")); - } - if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) { - OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); + if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) { + OutputDebugString(TEXT("Insufficient heap memory to write message\r\n")); + } } } #endif /* ifndef __WINRT__ */