From 3d4d28eeb0aed7f9aadfd6636ac17327c7fa7c44 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 25 Jan 2003 10:09:39 +0000 Subject: [PATCH] fix newlines in static log --- stepmania/src/archutils/Win32/Crash.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stepmania/src/archutils/Win32/Crash.cpp b/stepmania/src/archutils/Win32/Crash.cpp index 9503092c37..7b08f517cb 100644 --- a/stepmania/src/archutils/Win32/Crash.cpp +++ b/stepmania/src/archutils/Win32/Crash.cpp @@ -1563,7 +1563,7 @@ void StaticLog(const char *str) if(!staticlog_ptr) return; - int len = strlen(str)+2; /* +newline +null */ + int len = strlen(str)+3; /* +\r +\n +null */ if(staticlog_ptr+len >= staticlog_end) { const char *txt = "\nStaticlog limit reached\n"; @@ -1578,6 +1578,7 @@ void StaticLog(const char *str) strcpy(staticlog_ptr, str); + staticlog_ptr[len-3] = '\r'; staticlog_ptr[len-2] = '\n'; staticlog_ptr[len-1] = 0; /* Advance to sit on the NULL, so the terminator will be overwritten @@ -1588,6 +1589,8 @@ void StaticLog(const char *str) static void ReportStaticLog(HWND hwnd, HANDLE hFile) { Report(NULL, hFile, "Static log:"); - Report(hwnd, hFile, "%s", staticlog); + DWORD dwActual; + WriteFile(hFile, staticlog, staticlog_ptr-staticlog, &dwActual, NULL); +// Report(hwnd, hFile, "%s", staticlog); }