sprintf->snprintf, fix some too short buffers

This commit is contained in:
Henrik Rydgard committed 2014-09-14 00:14:11 +02:00
1 parent 170e88838f
commit f84ebf6bff
18 files changed
+66 -65

No files matched your search

+3 -4
View File
@@ -721,11 +721,10 @@ BOOL CDisasm::DlgProc(UINT message, WPARAM wParam, LPARAM lParam)
void CDisasm::updateThreadLabel(bool clear)
{
char label[512];
if (clear)
{
sprintf(label,"Thread: -");
if (clear) {
snprintf(label, sizeof(label), "Thread: -");
} else {
sprintf(label,"Thread: %s",threadList->getCurrentThreadName());
snprintf(label, sizeof(label), "Thread: %s", threadList->getCurrentThreadName());
}
SetDlgItemText(m_hDlg, IDC_THREADNAME, ConvertUTF8ToWString(label).c_str());