From a2e5ce241839c55a85e52ea12d7b444f2cbe20e0 Mon Sep 17 00:00:00 2001 From: Travis Wilson Date: Mon, 31 Aug 2020 17:19:56 -0700 Subject: [PATCH] Make experimental capture work on Windows with read-write temp file behavior --- include/internal/catch_output_redirect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/internal/catch_output_redirect.cpp b/include/internal/catch_output_redirect.cpp index 1308bfe3..6928d160 100644 --- a/include/internal/catch_output_redirect.cpp +++ b/include/internal/catch_output_redirect.cpp @@ -66,7 +66,7 @@ namespace Catch { if (tmpnam_s(m_buffer)) { CATCH_RUNTIME_ERROR("Could not get a temp filename"); } - if (fopen_s(&m_file, m_buffer, "w")) { + if (fopen_s(&m_file, m_buffer, "w+")) { char buffer[100]; if (strerror_s(buffer, errno)) { CATCH_RUNTIME_ERROR("Could not translate errno to a string");