summaryrefslogtreecommitdiff
path: root/plugins/UserInfoEx
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 /plugins/UserInfoEx
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 'plugins/UserInfoEx')
-rw-r--r--plugins/UserInfoEx/src/ctrl_button.cpp2
-rw-r--r--plugins/UserInfoEx/src/ctrl_contact.cpp14
-rw-r--r--plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp6
-rw-r--r--plugins/UserInfoEx/src/psp_profile.cpp4
4 files changed, 13 insertions, 13 deletions
diff --git a/plugins/UserInfoEx/src/ctrl_button.cpp b/plugins/UserInfoEx/src/ctrl_button.cpp
index 39b193a91c..aeb5477553 100644
--- a/plugins/UserInfoEx/src/ctrl_button.cpp
+++ b/plugins/UserInfoEx/src/ctrl_button.cpp
@@ -550,7 +550,7 @@ static LRESULT CALLBACK Button_WndProc(HWND hwndBtn, UINT uMsg, WPARAM wParam, L
case BUTTONTRANSLATE:
{
TCHAR szButton[MAX_PATH];
- GetWindowText(bct->hwnd, szButton, MAX_PATH);
+ GetWindowText(bct->hwnd, szButton, SIZEOF(szButton));
SetWindowText(bct->hwnd, TranslateTS(szButton));
}
break;
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp
index 110a40f80e..9c527acf06 100644
--- a/plugins/UserInfoEx/src/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/src/ctrl_contact.cpp
@@ -171,11 +171,11 @@ static INT_PTR CALLBACK DlgProc_EMail(HWND hDlg, UINT msg, WPARAM wParam, LPARAM
{
TCHAR szButton[MAX_PATH];
HWND hBtn = GetDlgItem(hDlg, IDOK);
- GetWindowText(hBtn, szButton, MAX_PATH);
+ GetWindowText(hBtn, szButton, SIZEOF(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
hBtn = GetDlgItem(hDlg, IDCANCEL);
- GetWindowText(hBtn, szButton, MAX_PATH);
+ GetWindowText(hBtn, szButton, SIZEOF(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
}
return TRUE;
@@ -253,10 +253,10 @@ INT_PTR CALLBACK DlgProc_Phone(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam
HWND hBtn;
hBtn = GetDlgItem(hDlg, IDOK);
- GetWindowText(hBtn, szButton, MAX_PATH);
+ GetWindowText(hBtn, szButton, SIZEOF(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
hBtn = GetDlgItem(hDlg, IDCANCEL);
- GetWindowText(hBtn, szButton, MAX_PATH);
+ GetWindowText(hBtn, szButton, SIZEOF(szButton));
SetWindowText(hBtn, TranslateTS(szButton));
}
if (*cbi->pszVal) SetWindowText(hDlg, LPGENT("Edit phone number"));
@@ -844,7 +844,7 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
int errorPos;
TCHAR szEdit[MAXDATASIZE];
- if (ccVal = GetWindowText(cbex->hEdit, szEdit, MAXDATASIZE)) {
+ if (ccVal = GetWindowText(cbex->hEdit, szEdit, SIZEOF(szEdit))) {
if (!(ccVal = CheckPhoneSyntax(szEdit, szVal, MAXDATASIZE, errorPos)) || errorPos > -1) {
SetWindowText(cbex->hEdit, szVal);
SendMessage(cbex->hEdit, EM_SETSEL, errorPos, errorPos);
@@ -853,10 +853,10 @@ static LRESULT CALLBACK CtrlContactWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
break;
}
case EDIT_EMAIL:
- ccVal = GetWindowText(cbex->hEdit, szVal, MAXDATASIZE);
+ ccVal = GetWindowText(cbex->hEdit, szVal, SIZEOF(szVal));
break;
default:
- ccVal = GetWindowText(cbex->hEdit, szVal, MAXDATASIZE);
+ ccVal = GetWindowText(cbex->hEdit, szVal, SIZEOF(szVal));
break;
}
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
index 6a5b667b26..f26e726efe 100644
--- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
+++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp
@@ -54,7 +54,7 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p
tvi.mask = TVIF_STATE|TVIF_TEXT;
tvi.stateMask = TVIS_STATEIMAGEMASK;
tvi.pszText = szModule;
- tvi.cchTextMax = MAXSETTING;
+ tvi.cchTextMax = SIZEOF(szModule);
do {
if (
@@ -225,7 +225,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
break;
}
TranslateDialogDefault(hDlg); //to translate oldTitle
- GetWindowText(hDlg, oldTitle, MAXSETTING);
+ GetWindowText(hDlg, oldTitle, SIZEOF(oldTitle));
mir_sntprintf(newTitle, MAXDATASIZE - 1, _T("%s - %s"), name, oldTitle);
SetWindowText(hDlg, newTitle);
}
@@ -394,7 +394,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar
tvi.mask = TVIF_TEXT;
tvi.pszText = szText;
- tvi.cchTextMax = sizeof(szText);
+ tvi.cchTextMax = SIZEOF(szText);
// search the tree item of optional items
for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
diff --git a/plugins/UserInfoEx/src/psp_profile.cpp b/plugins/UserInfoEx/src/psp_profile.cpp
index af4d83fd29..e9d8944e13 100644
--- a/plugins/UserInfoEx/src/psp_profile.cpp
+++ b/plugins/UserInfoEx/src/psp_profile.cpp
@@ -913,7 +913,7 @@ static LRESULT CALLBACK ProfileList_SubclassProc(HWND hwnd, UINT msg, WPARAM wPa
if (!PtrIsValid(pList = (LPLISTCTRL)GetUserData(hwnd)))
break;
- GetWindowText(pList->labelEdit.hEdit, szEdit, MAX_PATH);
+ GetWindowText(pList->labelEdit.hEdit, szEdit, SIZEOF(szEdit));
// need to create the dropdown list?
if (pList->labelEdit.dropDown.hDrop == NULL) {
@@ -1193,7 +1193,7 @@ INT_PTR CALLBACK PSPProcContactProfile(HWND hDlg, UINT uMsg, WPARAM wParam, LPAR
*szGroup = 0;
lvi.mask = LVIF_TEXT | LVIF_PARAM;
lvi.pszText = szGroup;
- lvi.cchTextMax = MAX_PATH;
+ lvi.cchTextMax = SIZEOF(szGroup);
for (iItem = lvi.iItem = lvi.iSubItem = 0; ListView_GetItem(hList, &lvi); lvi.iItem++) {
if (!PtrIsValid(pItem = (LPLCITEM)lvi.lParam)) {