Windows: Fixed wrong debugger output if logging empty string as info or warning.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Thu, 16 Jul 2015 21:31:21 +0200
changeset 9805 8a0142df6be5
parent 9804 ad692d1e780f
child 9806 2deeef7b793c
Windows: Fixed wrong debugger output if logging empty string as info or warning.
src/SDL_log.c
--- a/src/SDL_log.c	Wed Jul 15 21:12:04 2015 +0200
+++ b/src/SDL_log.c	Thu Jul 16 21:31:21 2015 +0200
@@ -371,9 +371,9 @@
         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__ */