From c16bd3d58396036f078282ad0b7032562c0c0533 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 1 Sep 2015 15:18:56 +0000 Subject: - adaptation for the kernel strdel(); - buffer overrun removed (rare crashes); - old useless code removed; - removal of a blank line after comments was a bad idea git-svn-id: http://svn.miranda-ng.org/main/trunk@15136 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/container.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'plugins/TabSRMM/src/container.cpp') diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 01a14c266f..7ba28e9fec 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1870,6 +1870,7 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) } } +///////////////////////////////////////////////////////////////////////////////////////// // cut off contact name to the option value set via Options->Tabbed messaging // some people were requesting this, because really long contact list names // are causing extraordinary wide tabs and these are looking ugly and wasting @@ -1877,15 +1878,13 @@ void TSAPI CloseOtherTabs(HWND hwndTab, TWindowData &dat) // // size = max length of target string -int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size) +int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, size_t size) { - size_t cutMax = PluginConfig.m_iTabNameLimit; - - if (mir_tstrlen(oldname) <= cutMax) + if (mir_tstrlen(oldname) <= PluginConfig.m_iTabNameLimit) _tcsncpy_s(newname, size, oldname, _TRUNCATE); else { TCHAR fmt[30]; - mir_sntprintf(fmt, _T("%%%d.%ds..."), cutMax, cutMax); + mir_sntprintf(fmt, _T("%%%d.%ds..."), PluginConfig.m_iTabNameLimit, PluginConfig.m_iTabNameLimit); mir_sntprintf(newname, size, fmt, oldname); } return 0; -- cgit v1.2.3