From 565f9b364c05296bbb912cdf6b6edd1437213818 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 6 Jun 2004 20:01:19 +0000 Subject: [PATCH] fix error handling --- stepmania/src/IniFile.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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; }