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/TopToolBar | |
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/TopToolBar')
-rw-r--r-- | plugins/TopToolBar/src/InternalButtons.cpp | 2 | ||||
-rw-r--r-- | plugins/TopToolBar/src/ttbopt.cpp | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index b7f5c8995f..fb7566729d 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -114,7 +114,7 @@ void InitInternalButtons() CreateServiceFunction(TTBI_STATUSMENUBUTT, TTBInternalStatusMenuButt);
CreateServiceFunction(TTBI_SHOWHIDEOFFLINE, TTBInternalShowHideOffline);
- for (int i = 0; i < SIZEOF(stdButtons); i++) {
+ for (int i = 0; i < _countof(stdButtons); i++) {
TTBButton ttb = {0};
ttb.cbSize = sizeof(ttb);
ttb.name = stdButtons[i].name;
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index 6f890d59aa..ec2eab562b 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -241,14 +241,14 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TCHAR str[MAX_PATH];
OPENFILENAME ofn = {0};
- GetDlgItemText(hwndDlg, IDC_EPATH, str, SIZEOF(str));
+ GetDlgItemText(hwndDlg, IDC_EPATH, str, _countof(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.hInstance = NULL;
ofn.lpstrFilter = NULL;
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST | OFN_EXPLORER;
- ofn.nMaxFile = SIZEOF(str);
+ ofn.nMaxFile = _countof(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = _T("exe");
if (!GetOpenFileName(&ofn))
@@ -290,14 +290,14 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR TreeView_SetItem(hTree, &tvi);
}
- GetDlgItemText(hwndDlg, IDC_ENAME, buf, SIZEOF(buf));
+ GetDlgItemText(hwndDlg, IDC_ENAME, buf, _countof(buf));
replaceStr(btn->pszName, _T2A(buf));
tvi.mask = TVIF_TEXT;
tvi.pszText = buf;
TreeView_SetItem(hTree, &tvi);
- GetDlgItemText(hwndDlg, IDC_EPATH, buf, SIZEOF(buf));
+ GetDlgItemText(hwndDlg, IDC_EPATH, buf, _countof(buf));
replaceStrT(btn->ptszProgram, buf);
}
break;
@@ -515,7 +515,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR tvis.item.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_STATE;
tvis.item.stateMask = 0xFFFFFFFF;
tvis.item.pszText = name;
- tvis.item.cchTextMax = SIZEOF(name);
+ tvis.item.cchTextMax = _countof(name);
tvis.item.hItem = dat->hDragItem;
TreeView_GetItem(hTree, &tvis.item);
|