Преглед на файлове

Windows: Fixed wrong debugger output if logging empty string as info or warning.

Philipp Wiesemann преди 10 години
родител
ревизия
16e18817e9
променени са 1 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 3 3
      src/SDL_log.c

+ 3 - 3
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__ */