diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-28 15:44:18 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-28 15:44:18 +0000 |
commit | 4fa9a8b4f873f5a97c74c3cac6fc1384b9b22f17 (patch) | |
tree | 10148c3460d43042feecba4cf1ec02958e3c4d24 /plugins/Clist_nicer/src | |
parent | ec112925e1c1419182451cc2f0f6e985d9ddb1de (diff) |
unsafe strncat removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@13876 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r-- | plugins/Clist_nicer/src/Include/commonheaders.h | 1 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 9 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 20 |
3 files changed, 15 insertions, 15 deletions
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h index a3b7759d7a..a78cab075e 100644 --- a/plugins/Clist_nicer/src/Include/commonheaders.h +++ b/plugins/Clist_nicer/src/Include/commonheaders.h @@ -57,6 +57,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <m_fontservice.h>
#include <m_xstatus.h>
#include <m_extraicons.h>
+#include <m_string.h>
#include <m_metacontacts.h>
#include <m_cln_skinedit.h>
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index bf285973c1..4e441c8c98 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -288,11 +288,10 @@ void LoadExtBkSettingsFromDB() ID_EXTBK_LAST++;
mir_snprintf(p->szDBname, SIZEOF(p->szDBname), "EXBK_%s", accs[i]->szModuleName);
- if (i == 0) {
- mir_strncpy(p->szName, "{-}", SIZEOF(p->szName));
- mir_strncat(p->szName, accs[i]->szModuleName, SIZEOF(p->szName) - mir_strlen(p->szName));
- }
- else mir_strncpy(p->szName, accs[i]->szModuleName, SIZEOF(p->szName));
+ if (i == 0)
+ mir_snprintf(p->szName, SIZEOF(p->szName), "{-}%s", accs[i]->szModuleName);
+ else
+ strncpy_s(p->szName, accs[i]->szModuleName, _TRUNCATE);
p->statusID = ID_EXTBK_LAST;
arStatusItems.insert(p);
}
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index d18dddb6d1..b2d6d8e753 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -321,9 +321,9 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr // saves the state of the filter definitions for the current item
void SaveState()
{
- TCHAR newGroupFilter[2048] = _T("|");
- char newProtoFilter[2048] = "|";
- int i, iLen;
+ CMString newGroupFilter(_T("|"));
+ CMStringA newProtoFilter("|");
+ int i;
HWND hwndList;
char *szModeName = NULL;
DWORD statusMask = 0;
@@ -345,9 +345,9 @@ void SaveState() item.cchTextMax = SIZEOF(szTemp);
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_strncat(newProtoFilter, szTemp, SIZEOF(newProtoFilter) - mir_strlen(newProtoFilter));
- mir_strncat(newProtoFilter, "|", SIZEOF(newProtoFilter) - mir_strlen(newProtoFilter));
- newProtoFilter[2047] = 0;
+
+ newProtoFilter.Append(szTemp);
+ newProtoFilter.AppendChar('|');
}
}
}
@@ -367,9 +367,9 @@ void SaveState() item.cchTextMax = SIZEOF(szTemp);
item.iItem = i;
SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- mir_tstrncat(newGroupFilter, szTemp, SIZEOF(newGroupFilter) - mir_tstrlen(newGroupFilter));
- mir_tstrncat(newGroupFilter, _T("|"), SIZEOF(newGroupFilter) - mir_tstrlen(newGroupFilter));
- newGroupFilter[2047] = 0;
+
+ newGroupFilter.Append(szTemp);
+ newGroupFilter.AppendChar('|');
}
}
}
@@ -378,7 +378,7 @@ void SaveState() if (ListView_GetCheckState(hwndList, i - ID_STATUS_OFFLINE))
statusMask |= (1 << (i - ID_STATUS_OFFLINE));
- iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
+ int iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
if (iLen) {
unsigned int stickies = 0;
DWORD dwGlobalMask, dwLocalMask;
|