Fix potential crash if the style has more columns than the max allowed.

This commit is contained in:
Steve Checkoway
2006-10-20 07:50:20 +00:00
parent 228e566f21
commit 56d052f6f1
+2 -2
View File
@@ -211,12 +211,12 @@ void ScreenNameEntry::Init()
const Style* pStyle = GAMESTATE->GetCurrentStyle();
const int iMaxCols = min( ABS_MAX_RANKING_NAME_LENGTH, pStyle->m_iColsPerPlayer );
m_ColToStringIndex[p].insert(m_ColToStringIndex[p].begin(), pStyle->m_iColsPerPlayer, -1);
int CurrentStringIndex = 0;
vector<float> xs;
for( int iCol=0; iCol<pStyle->m_iColsPerPlayer; iCol++ )
for( int iCol=0; iCol<iMaxCols; ++iCol )
{
if( CurrentStringIndex == MAX_RANKING_NAME_LENGTH )
break; /* We have enough columns. */