diff --git a/Source/Common/File Class.cpp b/Source/Common/File Class.cpp index 50416675f..f2f431bff 100644 --- a/Source/Common/File Class.cpp +++ b/Source/Common/File Class.cpp @@ -79,14 +79,12 @@ 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