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 98058a0142df6be5
parent 9804 ad692d1e780f
child 9806 2deeef7b793c
Windows: Fixed wrong debugger output if logging empty string as info or warning.
src/SDL_log.c
     1.1 --- a/src/SDL_log.c	Wed Jul 15 21:12:04 2015 +0200
     1.2 +++ b/src/SDL_log.c	Thu Jul 16 21:31:21 2015 +0200
     1.3 @@ -371,9 +371,9 @@
     1.4          if (consoleAttached == 1) {
     1.5                  if (!WriteConsole(stderrHandle, tstr, lstrlen(tstr), &charsWritten, NULL)) {
     1.6                      OutputDebugString(TEXT("Error calling WriteConsole\r\n"));
     1.7 -                }
     1.8 -                if (charsWritten == ERROR_NOT_ENOUGH_MEMORY) {
     1.9 -                    OutputDebugString(TEXT("Insufficient heap memory to write message\r\n"));
    1.10 +                    if (GetLastError() == ERROR_NOT_ENOUGH_MEMORY) {
    1.11 +                        OutputDebugString(TEXT("Insufficient heap memory to write message\r\n"));
    1.12 +                    }
    1.13                  }
    1.14          }
    1.15  #endif /* ifndef __WINRT__ */