Be careful about buffer overflow.

This commit is contained in:
Steve Checkoway
2006-08-09 22:07:53 +00:00
parent 36ecadb215
commit 129eda9df8
+1 -1
View File
@@ -102,7 +102,7 @@ void ThreadSlot::ThreadCheckpoint::Set( const char *szFile, int iLine, const cha
m_szFile = p+1;
}
sprintf( m_szFormattedBuf, " %s:%i %s", m_szFile, m_iLine, m_szMessage? m_szMessage:"" );
snprintf( m_szFormattedBuf, sizeof(m_szFormattedBuf), " %s:%i %s", m_szFile, m_iLine, m_szMessage? m_szMessage:"" );
}
const char *ThreadSlot::ThreadCheckpoint::GetFormattedCheckpoint()