From 958e8345292ae34336abf0722c82ede2692e9bf4 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 17:50:11 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13628 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/extBackg.cpp | 2 +- plugins/Clist_nicer/src/viewmodes.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 400376d435..0703e5dd8d 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -290,7 +290,7 @@ void LoadExtBkSettingsFromDB() mir_snprintf(p->szDBname, SIZEOF(p->szDBname), "EXBK_%s", accs[i]->szModuleName); if (i == 0) { mir_strncpy(p->szName, "{-}", SIZEOF(p->szName)); - strncat(p->szName, accs[i]->szModuleName, SIZEOF(p->szName)); + strncat(p->szName, accs[i]->szModuleName, SIZEOF(p->szName) - mir_strlen(p->szName)); } else mir_strncpy(p->szName, accs[i]->szModuleName, SIZEOF(p->szName)); p->statusID = ID_EXTBK_LAST; diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index b5908f5c6a..451be1aacb 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -345,8 +345,8 @@ void SaveState() item.cchTextMax = SIZEOF(szTemp); item.iItem = i; SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item); - strncat(newProtoFilter, szTemp, SIZEOF(newProtoFilter)); - strncat(newProtoFilter, "|", SIZEOF(newProtoFilter)); + strncat(newProtoFilter, szTemp, SIZEOF(newProtoFilter) - mir_strlen(newProtoFilter)); + strncat(newProtoFilter, "|", SIZEOF(newProtoFilter) - mir_strlen(newProtoFilter)); newProtoFilter[2047] = 0; } } @@ -367,8 +367,8 @@ void SaveState() item.cchTextMax = SIZEOF(szTemp); item.iItem = i; SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item); - _tcsncat(newGroupFilter, szTemp, SIZEOF(newGroupFilter)); - _tcsncat(newGroupFilter, _T("|"), SIZEOF(newGroupFilter)); + _tcsncat(newGroupFilter, szTemp, SIZEOF(newGroupFilter) - mir_tstrlen(newGroupFilter)); + _tcsncat(newGroupFilter, _T("|"), SIZEOF(newGroupFilter) - mir_tstrlen(newGroupFilter)); newGroupFilter[2047] = 0; } } -- cgit v1.2.3