From d65e5e4cf5e91e311d95325fa04d6883bf2a2d96 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Tue, 14 Jul 2015 21:31:39 +0000 Subject: HistoryLinklist: -Fixed https://www... links git-svn-id: http://svn.miranda-ng.org/main/trunk@14560 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryLinkListPlus/src/linklist_fct.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'plugins') diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index d7fefdaacb..926bbc02ae 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -137,16 +137,12 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart) type = LINK_URL; } - if (isLink && wordlen <= (LINK_MAX - _mstrlen(_T("http://")))) { - if (_tcsstr(wordsearch, _T("www.")) != NULL && _tcsstr(wordsearch, _T("http://")) == NULL) { - _tcsncpy_s(link, _T("http://"), _mstrlen(_T("http://"))); - // Link longer than defined max -> cut link to max - if (wordlen > (LINK_MAX - _mstrlen(_T("http://")))) - _tcsncpy_s((link + _mstrlen(_T("http://"))), (_countof(link) - _mstrlen(_T("http://"))), word, LINK_MAX - _mstrlen(_T("http://"))); - else - _tcsncpy_s((link + _mstrlen(_T("http://"))), (_countof(link) - _mstrlen(_T("http://"))), word, wordlen); + if (isLink && wordlen <= LINK_MAX) { + if (_tcsstr(wordsearch, _T("www.")) != NULL && _tcsstr(wordsearch, _T("http://")) == NULL && _tcsstr(wordsearch, _T("https://")) == NULL) { + _tcsncpy_s(link, _T("http://"), LINK_MAX); + _tcsncat_s(link, word, LINK_MAX); } else { - _tcsncpy_s(link, word, ((wordlen > LINK_MAX) ? LINK_MAX : wordlen)); + _tcsncpy_s(link, word, LINK_MAX); } TimeZone_ToStringT(dbei->timestamp, _T("d-t"), dbdate, _countof(dbdate)); -- cgit v1.2.3