diff --git a/common/piece.cpp b/common/piece.cpp index 11244a63..2dcde353 100644 --- a/common/piece.cpp +++ b/common/piece.cpp @@ -308,7 +308,8 @@ void lcPiece::CreateName(const lcArray& 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) diff --git a/qt/lc_config.h b/qt/lc_config.h index f9522ce5..1f2ddecb 100644 --- a/qt/lc_config.h +++ b/qt/lc_config.h @@ -28,6 +28,7 @@ typedef quintptr lcuintptr; #endif #ifdef Q_OS_WIN +#define snprintf _snprintf #define isnan _isnan #define strcasecmp stricmp #define strncasecmp strnicmp