summaryrefslogtreecommitdiff
path: root/Source/Core/Common/File.cpp
diff options
context:
space:
mode:
authorSepalani <sepalani@hotmail.fr>2017-06-17 02:16:58 +0100
committerSepalani <sepalani@hotmail.fr>2017-06-17 02:16:58 +0100
commitb359d82890b39bba59612da4a6fb66c1ebd8203f (patch)
tree45aef74c1f71d3a759f90cbefbbf5fb5a89b460c /Source/Core/Common/File.cpp
parent10beb2aea1f9a0ea6728a2905bbaf9ea1d7c931d (diff)
File/IOFile: Check _tfopen_s properly
Diffstat (limited to 'Source/Core/Common/File.cpp')
-rw-r--r--Source/Core/Common/File.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/Common/File.cpp b/Source/Core/Common/File.cpp
index 361943b93e..f3ede54fc2 100644
--- a/Source/Core/Common/File.cpp
+++ b/Source/Core/Common/File.cpp
@@ -60,12 +60,12 @@ bool IOFile::Open(const std::string& filename, const char openmode[])
{
Close();
#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
- m_file = fopen(filename.c_str(), openmode);
+ m_file = std::fopen(filename.c_str(), openmode);
+ m_good = m_file != nullptr;
#endif
- m_good = IsOpen();
return m_good;
}