1
0
mirror of synced 2024-11-28 09:30:51 +01:00

sys: Fixed non-existing files being created in Read mode

This commit is contained in:
WerWolv 2021-10-05 18:47:10 +02:00
parent 545604da63
commit 044e65eb20

View File

@ -9,7 +9,7 @@ namespace hex {
else if (mode == File::Mode::Write)
this->m_file = fopen64(path.c_str(), "r+b");
if (mode == File::Mode::Create || this->m_file == nullptr)
if (mode == File::Mode::Create || (mode == File::Mode::Write && this->m_file == nullptr))
this->m_file = fopen64(path.c_str(), "w+b");
}