Fix ignored writeStr return value in TiXmlDocument::SaveFile

Previously the TiXmlDocument::SaveFile could return true even when the underlying writeStr func failed.

Close #13774
This commit is contained in:
xomx 2023-06-12 14:33:12 +02:00 committed by Don Ho
parent 28594daef3
commit b0e849fe65
1 changed files with 1 additions and 2 deletions

View File

@ -784,8 +784,7 @@ bool TiXmlDocument::SaveFile( const TCHAR * filename ) const
std::unique_ptr<std::string> outputStr = std::make_unique<std::string>(); std::unique_ptr<std::string> outputStr = std::make_unique<std::string>();
Print(*outputStr, 0); Print(*outputStr, 0);
if (!outputStr->empty()) if (!outputStr->empty())
file.writeStr(*outputStr); return file.writeStr(*outputStr);
return true;
} }
return false; return false;