From 3ef3c6ff89519ddfd0ea62a2ff5d7c8ab055b593 Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Thu, 31 Mar 2016 15:01:41 -0700 Subject: [PATCH] UI: Fix inconsistent crash log line endings --- obs/obs-app.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obs/obs-app.cpp b/obs/obs-app.cpp index 83ce4cf6e..aaf3fe976 100644 --- a/obs/obs-app.cpp +++ b/obs/obs-app.cpp @@ -1194,6 +1194,7 @@ static void main_crash_handler(const char *format, va_list args, void *param) char *text = new char[MAX_CRASH_REPORT_SIZE]; vsnprintf(text, MAX_CRASH_REPORT_SIZE, format, args); + text[MAX_CRASH_REPORT_SIZE - 1] = 0; delete_oldest_file("obs-studio/crashes"); @@ -1203,7 +1204,8 @@ static void main_crash_handler(const char *format, va_list args, void *param) BPtr path(GetConfigPathPtr(name.c_str())); fstream file; - file.open(path, ios_base::in | ios_base::out | ios_base::trunc); + file.open(path, ios_base::in | ios_base::out | ios_base::trunc | + ios_base::binary); file << text; file.close();