diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/DbEditorPP/src/main_window.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP/src/main_window.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index 87482e939d..74723eb983 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -116,7 +116,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = TreeView_GetSelection(hwnd);
tvi.pszText = text;
- tvi.cchTextMax = SIZEOF(text);
+ tvi.cchTextMax = _countof(text);
if (TreeView_GetItem(hwnd, &tvi) && tvi.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)tvi.lParam;
MCONTACT hContact = mtis->hContact;
@@ -177,7 +177,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd, UINT msg, WPARAM wPar char setting[FLD_SIZE];
int idx = ListView_GetSelectionMark(hwnd);
if (idx == -1 ) return 0;
- ListView_GetItemTextA(hwnd, idx, 0, setting, SIZEOF(setting));
+ ListView_GetItemTextA(hwnd, idx, 0, setting, _countof(setting));
if (wParam == VK_F2)
editSetting(info.hContact, info.module, setting);
@@ -322,7 +322,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) TVITEM tvi = { 0 };
tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.pszText = text;
- tvi.cchTextMax = SIZEOF(text);
+ tvi.cchTextMax = _countof(text);
tvi.hItem = item;
if (TreeView_GetItem(hwnd2Tree, &tvi)) {
MCONTACT hContact = 0;
@@ -348,7 +348,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) if (pos != -1) {
char data[FLD_SIZE];
- ListView_GetItemTextA(hwnd2List, pos, 0, data, SIZEOF(data));
+ ListView_GetItemTextA(hwnd2List, pos, 0, data, _countof(data));
db_set_s(NULL, modname, "LastSetting", data);
}
else
@@ -409,7 +409,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
tvi.hItem = TreeView_GetSelection(hwnd2Tree);
tvi.pszText = text; // modulename
- tvi.cchTextMax = SIZEOF(text);
+ tvi.cchTextMax = _countof(text);
if (!TreeView_GetItem(hwnd2Tree, &tvi)) break;
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)tvi.lParam;
if (mtis && (mtis->type == MODULE))
|