Fixed buffer overflow with parts with very long descriptions.

This commit is contained in:
leo
2014-05-03 21:22:21 +00:00
parent fe2e759bc0
commit 6387ca917f
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -308,7 +308,8 @@ void lcPiece::CreateName(const lcArray<Piece*>& Pieces)
max = i;
}
sprintf (m_strName, "%s #%.2d", mPieceInfo->m_strDescription, max+1);
snprintf(m_strName, sizeof(m_strName), "%s #%.2d", mPieceInfo->m_strDescription, max+1);
m_strName[sizeof(m_strName) - 1] = 0;
}
void lcPiece::InsertTime(unsigned short start, unsigned short time)