diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2015-08-28 20:30:29 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2015-08-28 20:30:29 +0000 |
commit | 86ffbe56a77e202ee195bc48a8d61b454e256b84 (patch) | |
tree | 28cbb2e1bf93a80a00ad27ab1928c86ae792be73 /plugins/TabSRMM/src/contactcache.cpp | |
parent | 515b07f0d98c647c5151867d75a6c8a05d329bfa (diff) |
TabSEMM:
- minor leak fixed
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@15073 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TabSRMM/src/contactcache.cpp')
-rw-r--r-- | plugins/TabSRMM/src/contactcache.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index e6e829119b..a9c3a81940 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -115,12 +115,11 @@ void CContactCache::updateState() */ bool CContactCache::updateNick() { - bool fChanged = false; - + bool fChanged = false; if (m_Valid) { - TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); - if (tszNick) - fChanged = (mir_tstrcmp(m_szNick, tszNick) ? true : false); + TCHAR *tszNick = pcli->pfnGetContactDisplayName(getActiveContact(), 0); + if (tszNick && mir_tstrcmp(m_szNick, tszNick)) + fChanged = true; _tcsncpy_s(m_szNick, (tszNick ? tszNick : _T("<undef>")), _TRUNCATE); } return fChanged; @@ -272,12 +271,9 @@ void CContactCache::setWindowData(const HWND hwnd, TWindowData *dat) * saves message to the input history. * it's using streamout in UTF8 format - no unicode "issues" and all RTF formatting is saved to the history. */ - void CContactCache::saveHistory(WPARAM wParam, LPARAM) { - size_t iLength = 0, iStreamLength = 0; - int oldTop = 0; - char* szFromStream = NULL; + int oldTop = 0; if (m_hwnd == 0 || m_dat == 0) return; @@ -287,8 +283,9 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM) m_iHistoryTop = (int)wParam; } - szFromStream = ::Message_GetFromStream(GetDlgItem(m_hwnd, IDC_MESSAGE), SF_RTFNOOBJS | SFF_PLAINRTF | SF_NCRFORNONASCII); + char *szFromStream = ::Message_GetFromStream(GetDlgItem(m_hwnd, IDC_MESSAGE), SF_RTFNOOBJS | SFF_PLAINRTF | SF_NCRFORNONASCII); if (szFromStream != NULL) { + size_t iLength = 0, iStreamLength = 0; iLength = iStreamLength = (mir_strlen(szFromStream) + 1); if (iLength > 0 && m_history != NULL) { // XXX: iLength > 1 ? |