[CABMAN] Fix a problem with creating temp files on some Windows system

This commit is contained in:
Timo Kreuzer
2018-12-29 21:37:42 +01:00
parent 86ea03bf51
commit bcb0d7c6c9
+6 -1
View File
@@ -56,7 +56,12 @@ CCFDATAStorage::~CCFDATAStorage()
ULONG CCFDATAStorage::Create()
{
if ((FileHandle = tmpfile()) == NULL)
return CAB_STATUS_CANNOT_CREATE;
{
/* Workaround for breakage on some Windows system */
FileHandle = fopen(tmpnam(NULL) + 1, "wb");
if (FileHandle == NULL)
return CAB_STATUS_CANNOT_CREATE;
}
return CAB_STATUS_SUCCESS;
}