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/BossKeyPlus/src/BossKey.cpp | 6 +++--- plugins/BossKeyPlus/src/Options.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/BossKeyPlus/src') diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 61bafe3dc6..623685f7d6 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -118,7 +118,7 @@ INT_PTR CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam uid = LOWORD(wParam); if (uid == IDOK){ char password[MAXPASSLEN + 1] = { 0 }; - int passlen = GetDlgItemTextA(hDlg, IDC_EDIT1, password, SIZEOF(password)); + int passlen = GetDlgItemTextA(hDlg, IDC_EDIT1, password, _countof(password)); if (passlen == 0) { SetDlgItemText(hDlg, IDC_HEADERBAR, TranslateT("Miranda NG is locked.\nEnter password to unlock it.")); SendDlgItemMessage(hDlg, IDC_HEADERBAR, WM_NCPAINT, 0, 0); @@ -491,7 +491,7 @@ static TCHAR *HokeyVkToName(WORD vkKey) code |= (1UL << 24); } - GetKeyNameText(code, buf, SIZEOF(buf)); + GetKeyNameText(code, buf, _countof(buf)); return buf; } @@ -713,7 +713,7 @@ extern "C" int __declspec(dllexport) Load(void) db_set_b(NULL, "Popup", "ModuleIsEnabled", 0); } - Icon_Register(g_hInstance, "BossKey", iconList, SIZEOF(iconList)); + Icon_Register(g_hInstance, "BossKey", iconList, _countof(iconList)); g_hHideService = CreateServiceFunction(MS_BOSSKEY_HIDE, BossKeyHideMiranda); // Create service diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index 74e44af6b3..fc37629d20 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -80,7 +80,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam // status msg, if needed if (IsWindowEnabled(GetDlgItem(hwndDlg, IDC_MAINOPT_STATMSG))) { // meaning we should save it TCHAR tszMsg[1025]; - GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, SIZEOF(tszMsg)); + GetDlgItemText(hwndDlg, IDC_MAINOPT_STATMSG, tszMsg, _countof(tszMsg)); if (tszMsg[0] != 0) db_set_ts(NULL, MOD_NAME, "statmsg", tszMsg); else // delete current setting @@ -92,7 +92,7 @@ INT_PTR CALLBACK MainOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam // checkbox if (IsDlgButtonChecked(hwndDlg, IDC_MAINOPT_REQPASS) == BST_CHECKED) { char szPass[MAXPASSLEN + 1]; - GetDlgItemTextA(hwndDlg, IDC_MAINOPT_PASS, szPass, SIZEOF(szPass)); + GetDlgItemTextA(hwndDlg, IDC_MAINOPT_PASS, szPass, _countof(szPass)); if (szPass[0] != 0){ db_set_s(NULL, MOD_NAME, "password", szPass); wMask |= OPT_REQPASS; @@ -258,7 +258,7 @@ INT_PTR CALLBACK AdvOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) BossKeyMenuItemUnInit(); TCHAR szMinutes[4] = { 0 }; - GetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes, SIZEOF(szMinutes)); + GetDlgItemText(hwndDlg, IDC_MAINOPT_TIME, szMinutes, _countof(szMinutes)); minutes = _ttoi(szMinutes); if (minutes < 1) minutes = 1; db_set_b(NULL, MOD_NAME, "time", minutes); -- cgit v1.2.3