summaryrefslogtreecommitdiff
path: root/Source/Core/Common/File.cpp
diff options
context:
space:
mode:
authorshuffle2 <godisgovernment@gmail.com>2017-06-17 15:03:10 -0700
committerGitHub <noreply@github.com>2017-06-17 15:03:10 -0700
commite9c05355195fb2799183090c815623d798fed40e (patch)
tree57ee819c9c10b8d77a4ef15fd8b454d06ca2dab4 /Source/Core/Common/File.cpp
parenta8b11fb1f5ff36b2e73665487a60bafb0c7f8536 (diff)
parentb359d82890b39bba59612da4a6fb66c1ebd8203f (diff)
Merge pull request #5632 from sepalani/file
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;
}