From 942b909abaf0bba3fc5dedfa19dc9a2121960f05 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 18:48:46 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13648 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/eventpopups.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 0765a23fc8..7f3bf5ba3a 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -517,10 +517,10 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe); if (szPreview) { - _tcsncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, MAX_SECONDLINE); + _tcsncat(pdata->eventData[pdata->nrMerged].tszText, szPreview, SIZEOF(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText)); mir_free(szPreview); } - else _tcsncat(pdata->eventData[pdata->nrMerged].tszText, _T(" "), MAX_SECONDLINE); + else _tcsncat(pdata->eventData[pdata->nrMerged].tszText, _T(" "), SIZEOF(pdata->eventData[pdata->nrMerged].tszText) - mir_tstrlen(pdata->eventData[pdata->nrMerged].tszText)); pdata->eventData[pdata->nrMerged].tszText[MAX_SECONDLINE - 1] = 0; @@ -544,7 +544,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent) } i = (available > 0) ? i + 1 : i + 2; for (; i <= pdata->nrMerged; i++) - _tcsncat(lpzText, pdata->eventData[i].tszText, SIZEOF(lpzText)); + _tcsncat(lpzText, pdata->eventData[i].tszText, SIZEOF(lpzText) - mir_tstrlen(lpzText)); pdata->eventData[pdata->nrMerged].hEvent = hEvent; pdata->eventData[pdata->nrMerged].timestamp = dbe.timestamp; -- cgit v1.2.3