mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-19 00:17:56 +02:00
Fix issues reported by Sonar, review fixes
This commit is contained in:
@ -15,12 +15,11 @@ VCMI_LIB_NAMESPACE_BEGIN
|
||||
CSaveFile::CSaveFile(const boost::filesystem::path &fname)
|
||||
: serializer(this)
|
||||
, sfile(fname.c_str(), std::ios::out | std::ios::binary)
|
||||
, fName(fname)
|
||||
{
|
||||
sfile.exceptions(std::ifstream::failbit | std::ifstream::badbit); //we throw a lot anyway
|
||||
|
||||
if(!sfile)
|
||||
throw std::runtime_error("Error: cannot open file '" + fName.string() + "' for writing!");
|
||||
throw std::runtime_error("Error: cannot open file '" + fname.string() + "' for writing!");
|
||||
|
||||
sfile.write("VCMI", 4); //write magic identifier
|
||||
serializer & ESerializationVersion::CURRENT; //write format version
|
||||
|
Reference in New Issue
Block a user