report errors in LoadEditableDataFromDir

This commit is contained in:
Glenn Maynard
2005-04-24 22:56:05 +00:00
parent d8e675a1c4
commit 9928ed6bde
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -982,7 +982,7 @@ XNode* Profile::SaveGeneralDataCreateNode() const
return pGeneralDataNode;
}
void Profile::LoadEditableDataFromDir( CString sDir )
Profile::LoadResult Profile::LoadEditableDataFromDir( CString sDir )
{
CString fn = sDir + EDITABLE_INI;
@@ -993,9 +993,11 @@ void Profile::LoadEditableDataFromDir( CString sDir )
if( iBytes > MAX_EDITABLE_INI_SIZE_BYTES )
{
LOG->Warn( "The file '%s' is unreasonably large. It won't be loaded.", fn.c_str() );
return;
return failed_tampered;
}
if( !IsAFile(fn) )
return failed_no_profile;
IniFile ini;
ini.ReadFile( fn );
@@ -1012,6 +1014,8 @@ void Profile::LoadEditableDataFromDir( CString sDir )
// TODO: strip invalid chars?
if( m_iWeightPounds != 0 )
CLAMP( m_iWeightPounds, 50, 500 );
return success;
}
bool Profile::FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName )
+1 -1
View File
@@ -282,7 +282,7 @@ public:
LoadResult LoadAllFromDir( CString sDir, bool bRequireSignature );
bool SaveAllToDir( CString sDir, bool bSignData ) const;
void LoadEditableDataFromDir( CString sDir );
LoadResult LoadEditableDataFromDir( CString sDir );
static bool FastLoadProfileNameFromMemoryCard( CString sDir, CString &sName );
LoadResult LoadStatsXmlFromNode( const XNode* pNode );
void LoadGeneralDataFromNode( const XNode* pNode );