mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
IOFile: Correct explicit operator bool semantics
The operator void* variant was m_good ? m_file : nullptr; so this was leaving out the file handle check.
This commit is contained in:
@@ -211,7 +211,7 @@ public:
|
||||
bool IsOpen() const { return nullptr != m_file; }
|
||||
// m_good is set to false when a read, write or other function fails
|
||||
bool IsGood() const { return m_good; }
|
||||
explicit operator bool() const { return IsGood(); }
|
||||
explicit operator bool() const { return IsGood() && IsOpen(); }
|
||||
std::FILE* ReleaseHandle();
|
||||
|
||||
std::FILE* GetHandle() { return m_file; }
|
||||
|
||||
Reference in New Issue
Block a user