File/IOFile: Check _tfopen_s properly
This commit is contained in:
parent
10beb2aea1
commit
b359d82890
|
@ -60,12 +60,12 @@ bool IOFile::Open(const std::string& filename, const char openmode[])
|
||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
_tfopen_s(&m_file, UTF8ToTStr(filename).c_str(), UTF8ToTStr(openmode).c_str());
|
m_good = _tfopen_s(&m_file, UTF8ToTStr(filename).c_str(), UTF8ToTStr(openmode).c_str()) == 0;
|
||||||
#else
|
#else
|
||||||
m_file = fopen(filename.c_str(), openmode);
|
m_file = std::fopen(filename.c_str(), openmode);
|
||||||
|
m_good = m_file != nullptr;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_good = IsOpen();
|
|
||||||
return m_good;
|
return m_good;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue