From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Jun 2015 19:35:42 +0000 Subject: SIZEOF replaced with more secure analog - _countof git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/GmailNotifier/src/options.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/GmailNotifier') diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 19ce5830ac..f329cbf2e0 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -1,7 +1,7 @@ #include "gmail.h" static void SaveButton(HWND hwndDlg,HWND hwndCombo, int curIndex) { - if (GetDlgItemTextA(hwndDlg, IDC_NAME, acc[curIndex].name, SIZEOF(acc[curIndex].name))) { + if (GetDlgItemTextA(hwndDlg, IDC_NAME, acc[curIndex].name, _countof(acc[curIndex].name))) { char *tail = strstr(acc[curIndex].name, "@"); if (tail && mir_strcmp(tail + 1, "gmail.com") != 0) mir_strcpy(acc[curIndex].hosted, tail + 1); @@ -10,7 +10,7 @@ static void SaveButton(HWND hwndDlg,HWND hwndCombo, int curIndex) { SendMessageA(hwndCombo, CB_SETCURSEL, curIndex, 0); db_set_s(acc[curIndex].hContact, pluginName, "name", acc[curIndex].name); db_set_s(acc[curIndex].hContact, pluginName, "Nick", acc[curIndex].name); - GetDlgItemTextA(hwndDlg, IDC_PASS, acc[curIndex].pass, SIZEOF(acc[curIndex].pass)); + GetDlgItemTextA(hwndDlg, IDC_PASS, acc[curIndex].pass, _countof(acc[curIndex].pass)); db_set_s(acc[curIndex].hContact, pluginName, "Password", acc[curIndex].pass); } } @@ -128,12 +128,12 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA OPENFILENAME OpenFileName; TCHAR szName[_MAX_PATH]; memset(&OpenFileName, 0, sizeof(OPENFILENAME)); - GetDlgItemText(hwndDlg, IDC_PRG, szName, SIZEOF(szName)); + GetDlgItemText(hwndDlg, IDC_PRG, szName, _countof(szName)); OpenFileName.lStructSize = sizeof(OPENFILENAME); OpenFileName.hwndOwner = hwndDlg; OpenFileName.lpstrFilter = _T("Executables (*.exe;*.com;*.bat)\0*.exe;*.com;*.bat\0\0"); OpenFileName.lpstrFile = szName; - OpenFileName.nMaxFile = SIZEOF(szName); + OpenFileName.nMaxFile = _countof(szName); OpenFileName.Flags = OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST; if (!GetOpenFileName(&OpenFileName)) return 0; @@ -224,7 +224,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA else if (IsDlgButtonChecked(hwndDlg, IDC_STARTPRG) == BST_CHECKED) { opt.OpenUsePrg = 2; } - GetDlgItemTextA(hwndDlg, IDC_PRG, str, SIZEOF(str)); + GetDlgItemTextA(hwndDlg, IDC_PRG, str, _countof(str)); db_set_dw(NULL, pluginName, "OpenUsePrg", opt.OpenUsePrg); db_set_s(NULL, pluginName, "OpenUsePrgPath", str); -- cgit v1.2.3