From a8a11e811c3c0cc3f6d74c18c89841e9e0e87237 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Sun, 30 Nov 2014 04:29:19 +0000 Subject: Multiple fixes buff size for GetText and SetText. git-svn-id: http://svn.miranda-ng.org/main/trunk@11165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TipperYM/src/mir_smileys.cpp | 4 ++-- plugins/TipperYM/src/options.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/TipperYM') diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index f2ae1783dc..074df144f1 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -41,7 +41,7 @@ SMILEYPARSEINFO Smileys_PreParse(LPCTSTR lpString, int nCount, const char *proto return NULL; if (nCount == -1) - nCount = (int)lstrlen(lpString); + nCount = lstrlen(lpString); SMILEYPARSEINFO info = (SMILEYPARSEINFO) mir_calloc(sizeof(tagSMILEYPARSEINFO)); info->pieces = ReplaceSmileys(lpString, nCount, protocol, &info->max_height); @@ -72,7 +72,7 @@ void Smileys_FreeParse(SMILEYPARSEINFO parseInfo) int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT uFormat, const char *protocol, SMILEYPARSEINFO parseInfo) { if (nCount == -1) - nCount = (int)lstrlen(lpString); + nCount = lstrlen(lpString); if (uFormat & DT_CALCRECT) { SIZE text_size = GetTextSize(hDC, lpString, parseInfo, uFormat, parseInfo->max_height, (lpRect->right - lpRect->left)); diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 5df05097e9..2f10a335e7 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -1075,7 +1075,7 @@ INT_PTR CALLBACK DlgProcOptsContent(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.stateMask = TVIS_STATEIMAGEMASK; item.hItem = hItem; item.pszText = buff; - item.cchTextMax = 512; + item.cchTextMax = SIZEOF(buff); if (TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_FIRST_ITEMS), &item)) { tmpParam = item.lParam; @@ -1794,7 +1794,7 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_STATE; tvis.item.stateMask = TVIS_STATEIMAGEMASK; tvis.item.pszText = swzName; - tvis.item.cchTextMax = 256; + tvis.item.cchTextMax = SIZEOF(swzName); tvis.item.hItem = dat->hDragItem; tvis.item.state = INDEXTOSTATEIMAGEMASK(((ICONSTATE *)item.lParam)->vis ? 2 : 1); TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE_EXTRAICONS), &tvis.item); @@ -2215,7 +2215,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA TVITEM item; item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS)); item.pszText = buff; - item.cchTextMax = 256; + item.cchTextMax = SIZEOF(buff); item.mask = TVIF_HANDLE | TVIF_TEXT | TVIF_STATE; item.stateMask = TVIS_STATEIMAGEMASK; while (item.hItem != NULL) -- cgit v1.2.3