Make experimental capture work on Windows with read-write temp file behavior

This commit is contained in:
Travis Wilson 2020-08-31 17:19:56 -07:00 committed by Martin Hořeňovský
parent 2454cfffb7
commit b0214ff862
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -64,7 +64,7 @@ namespace Catch {
if (tmpnam_s(m_buffer)) { if (tmpnam_s(m_buffer)) {
CATCH_RUNTIME_ERROR("Could not get a temp filename"); 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]; char buffer[100];
if (strerror_s(buffer, errno)) { if (strerror_s(buffer, errno)) {
CATCH_RUNTIME_ERROR("Could not translate errno to a string"); CATCH_RUNTIME_ERROR("Could not translate errno to a string");