summaryrefslogtreecommitdiff
path: root/protocols/IRCG/src
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-11-30 04:29:19 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-11-30 04:29:19 +0000
commita8a11e811c3c0cc3f6d74c18c89841e9e0e87237 (patch)
tree775e65659d26870bba82b84fb584a5301606ff62 /protocols/IRCG/src
parent79041310665c9b0b93c368bb1f7cef5f669a419e (diff)
Multiple fixes buff size for GetText and SetText.
git-svn-id: http://svn.miranda-ng.org/main/trunk@11165 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG/src')
-rw-r--r--protocols/IRCG/src/ui_utils.cpp1
-rw-r--r--protocols/IRCG/src/windows.cpp13
2 files changed, 3 insertions, 11 deletions
diff --git a/protocols/IRCG/src/ui_utils.cpp b/protocols/IRCG/src/ui_utils.cpp
index fa1f5dea2d..e02ab4ed5f 100644
--- a/protocols/IRCG/src/ui_utils.cpp
+++ b/protocols/IRCG/src/ui_utils.cpp
@@ -1290,7 +1290,6 @@ void CCtrlTreeView::TranslateItem(HTREEITEM hItem)
GetItem(hItem, &tvi, buf, SIZEOF(buf));
tvi.pszText = TranslateTS(tvi.pszText);
- tvi.cchTextMax = lstrlen(tvi.pszText);
SetItem(&tvi);
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index bb1f6d889c..bfd6fb58e6 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -322,7 +322,7 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
LVITEM lvm;
TCHAR text[255];
lvm.pszText = text; // Set buffer for texts
- lvm.cchTextMax = 128;
+ lvm.cchTextMax = SIZEOF(text);
lvm.mask = LVIF_TEXT;
for (int i = 0; i < j; i++) {
lvm.iSubItem = 0; // First column
@@ -332,13 +332,6 @@ INT_PTR CListDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
// Match the text?
TCHAR* t = _tcsstr(lvm.pszText, strFilterText);
if (t == NULL) { // If no, then Check if in the topics
- LVITEM lvm2; // To avoid to overwrite the external lvm
- TCHAR text[300];
- lvm2.pszText = text; // Set buffer for texts
- lvm2.cchTextMax = SIZEOF(text);
- lvm2.mask = LVIF_TEXT;
- lvm2.iSubItem = 3; // Topic column
- lvm2.iItem = i;
m_list.GetItem(&lvm);
// Match the text?
@@ -434,7 +427,7 @@ static int CALLBACK ListViewSort(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSo
lvm.iItem = lParam1;
lvm.iSubItem = param->iSubItem;
lvm.pszText = temp1;
- lvm.cchTextMax = 511;
+ lvm.cchTextMax = SIZEOF(temp1);
param->pList->GetItem(&lvm);
lvm.iItem = lParam2;
lvm.pszText = temp2;
@@ -643,7 +636,7 @@ void CQuickDlg::OnOk(CCtrlButton*)
}
TCHAR windowname[20];
- GetWindowText(m_hwnd, windowname, 20);
+ GetWindowText(m_hwnd, windowname, SIZEOF(windowname));
if (lstrcmpi(windowname, _T("Miranda IRC")) == 0) {
m_proto->m_serverComboSelection = m_serverCombo.GetCurSel() - 1;
m_proto->setDword("ServerComboSelection", m_proto->m_serverComboSelection);