This commit is contained in:
Chris Danford
2005-02-17 05:56:02 +00:00
parent 6f88bf18c0
commit 682bd1364c
+4 -2
View File
@@ -41,6 +41,8 @@ const CString COMMON_XSL = "Common.xsl";
* 10 /* HighScores per Steps */ \ * 10 /* HighScores per Steps */ \
* 1024 /* size in bytes of a HighScores XNode */ * 1024 /* size in bytes of a HighScores XNode */
#define MAX_DISPLAY_NAME_LENGTH 12
#if defined(WIN32) #if defined(WIN32)
#pragma warning (disable : 4706) // assignment within conditional expression #pragma warning (disable : 4706) // assignment within conditional expression
#endif #endif
@@ -925,8 +927,8 @@ void Profile::LoadEditableDataFromDir( CString sDir )
// This is data that the user can change, so we have to validate it. // This is data that the user can change, so we have to validate it.
wstring wstr = CStringToWstring(m_sDisplayName); wstring wstr = CStringToWstring(m_sDisplayName);
if( wstr.size() > 12 ) if( wstr.size() > MAX_DISPLAY_NAME_LENGTH )
wstr = wstr.substr(0, 12); wstr = wstr.substr(0, MAX_DISPLAY_NAME_LENGTH);
m_sDisplayName = WStringToCString(wstr); m_sDisplayName = WStringToCString(wstr);
// TODO: strip invalid chars? // TODO: strip invalid chars?
if( m_iWeightPounds != 0 ) if( m_iWeightPounds != 0 )