diff options
author | George Hazan <george.hazan@gmail.com> | 2014-12-01 23:27:22 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-12-01 23:27:22 +0000 |
commit | 15b4d00e919d97015c208fff867862ef028995de (patch) | |
tree | 153c71d62dac1a17eaf469f52a6c2dfe9f7a28ae /plugins/TabSRMM/src/container.cpp | |
parent | cc15bc68febf4de6cd357ea9192de2e876ab290e (diff) |
static mir_tstrncpy replaced with direct _tcsncpy_s calls
git-svn-id: http://svn.miranda-ng.org/main/trunk@11209 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/container.cpp')
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 37f5c4a4d9..7239a16651 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1990,15 +1990,12 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size { int cutMax = PluginConfig.m_CutContactNameTo; - if (mir_tstrlen(oldname) <= cutMax) { - mir_tstrncpy(newname, oldname, size); - newname[size - 1] = 0; - } + if (mir_tstrlen(oldname) <= cutMax) + _tcsncpy_s(newname, size, oldname, _TRUNCATE); else { - TCHAR fmt[20]; - mir_sntprintf(fmt, 18, _T("%%%d.%ds..."), cutMax, cutMax); + TCHAR fmt[30]; + mir_sntprintf(fmt, SIZEOF(fmt), _T("%%%d.%ds..."), cutMax, cutMax); mir_sntprintf(newname, size, fmt, oldname); - newname[size - 1] = 0; } return 0; } |