diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index f9eb583eb..cc73de345 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -79,14 +79,10 @@ bool CFile::Open(const char * lpszFileName, uint32_t nOpenFlags) sa.bInheritHandle = (nOpenFlags & modeNoInherit) == 0; // map creation flags - ULONG dwCreateFlag = 0; + ULONG dwCreateFlag = OPEN_EXISTING; if (nOpenFlags & modeCreate) { - dwCreateFlag = nOpenFlags & modeNoTruncate == 0 ? OPEN_ALWAYS : CREATE_ALWAYS; - } - else - { - dwCreateFlag = OPEN_EXISTING; + dwCreateFlag = ((nOpenFlags & modeNoTruncate) != 0) ? OPEN_ALWAYS : CREATE_ALWAYS; } // attempt file creation