From e61acad8085d66f210b03187955e5ce1923bd04a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Thu, 2 Aug 2012 11:14:17 +0000 Subject: Another crashfix for linklist. git-svn-id: http://svn.miranda-ng.org/main/trunk@1325 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins') diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 17036bb8f6..4e99d30a9d 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -207,9 +207,9 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart) if ( type == LINK_MAIL && _tcsstr(link, _T("mailto:")) == NULL ) { - _tcscpy_s(templink, _countof(templink), link); - _tcscpy_s(link, _countof(link), _T("mailto:")); - _tcsncpy_s(link + _mstrlen(_T("mailto:")), _countof(link), templink, LINK_MAX-_mstrlen(_T("mailto:"))); + _tcsncpy_s(templink, _countof(templink), link, LINK_MAX-1); + _tcsncpy_s(link, _countof(link), _T("mailto:"), LINK_MAX-1); + _tcsncpy_s(link + _mstrlen(_T("mailto:")), _countof(link), templink, LINK_MAX-_mstrlen(_T("mailto:"))-1); } // Add new Element to list: @@ -220,9 +220,9 @@ int ExtractURI(DBEVENTINFO *dbei, HANDLE hEvent, LISTELEMENT *listStart) ZeroMemory(newElement, sizeof(LISTELEMENT)); newElement->direction = direction; newElement->type = type; - _tcscpy_s(newElement->date, _countof(newElement->date), date); - _tcscpy_s(newElement->time, _countof(newElement->time), time); - _tcscpy_s(newElement->link, _countof(newElement->link), link); + _tcsncpy_s(newElement->date, _countof(newElement->date), date, DATE_SIZE-1); + _tcsncpy_s(newElement->time, _countof(newElement->time), time, TIME_SIZE-1); + _tcsncpy_s(newElement->link, _countof(newElement->link), link, LINK_MAX-1); newElement->hEvent = hEvent; actualElement = listStart; -- cgit v1.2.3