diff options
author | George Hazan <george.hazan@gmail.com> | 2015-09-01 15:18:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-09-01 15:18:56 +0000 |
commit | c16bd3d58396036f078282ad0b7032562c0c0533 (patch) | |
tree | 28a330ad3bd8ba85a20cd2b9a18d5186a0861e66 /plugins/TabSRMM/src/container.cpp | |
parent | 1b9f36054bddeef87d4f9c139877d28c4e6b1702 (diff) |
- 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
Diffstat (limited to 'plugins/TabSRMM/src/container.cpp')
-rw-r--r-- | plugins/TabSRMM/src/container.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
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;
|