Update UnitTestFileGenerator.h

kimkulling/add_windows_clang_issue-5519
Kim Kulling 2024-04-09 19:31:45 +01:00 committed by GitHub
parent ecd144b63e
commit 1587c61ee7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -54,14 +54,14 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <io.h> #include <io.h>
inline FILE* MakeTmpFile(char* tmplate) inline FILE* MakeTmpFile(char* tmplate)
{ {
auto pathtemplate = _mktemp_s(tmplate, std::strlen(tmplate)); auto err = _mktemp_s(tmplate, std::strlen(tmplate));
EXPECT_NE(pathtemplate, nullptr); EXPECT_NE(tmplate, nullptr);
if(pathtemplate == nullptr) if(tmplate == nullptr)
{ {
return nullptr; return nullptr;
} }
FILE *fs = nullptr; FILE *fs = nullptr;
auto err = fopen_s(&fs, pathtemplate, "w+"); auto err = fopen_s(&fs, tmplate, "w+");
EXPECT_EQ(err, 0); EXPECT_EQ(err, 0);
return fs; return fs;
} }