diff --git a/stepmania/src/IniFile.cpp b/stepmania/src/IniFile.cpp index 3ff1b8c3ee..27238dd30d 100644 --- a/stepmania/src/IniFile.cpp +++ b/stepmania/src/IniFile.cpp @@ -79,12 +79,21 @@ bool IniFile::WriteFile( const CString &sPath ) if (k->second.empty()) continue; - f.PutLine( ssprintf("[%s]", k->first.c_str()) ); + if( f.PutLine( ssprintf("[%s]", k->first.c_str()) ) == -1 ) + { + m_sError = f.GetError(); + return false; + } + for( key::const_iterator i = k->second.begin(); i != k->second.end(); ++i ) f.PutLine( ssprintf("%s=%s", i->first.c_str(), i->second.c_str()) ); - f.PutLine( "" ); + if( f.PutLine( "" ) == -1 ) + { + m_sError = f.GetError(); + return false; + } } return true; }