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/ProfileManager/src/pmanagerEx.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/ProfileManager/src') diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index d4d86defaa..e0ba4db09c 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -49,7 +49,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID) static INT_PTR ChangePM(WPARAM, LPARAM) { TCHAR fn[MAX_PATH]; - GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn)); + GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn)); ShellExecute(0, _T("open"), fn, _T("/ForceShowPM"), _T(""), 1); CallService("CloseAction", 0, 0); return 0; @@ -58,7 +58,7 @@ static INT_PTR ChangePM(WPARAM, LPARAM) static INT_PTR LoadPM(WPARAM, LPARAM) { TCHAR fn[MAX_PATH]; - GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn)); + GetModuleFileName(GetModuleHandle(NULL), fn, _countof(fn)); ShellExecute(0, _T("open"), fn, _T("/ForceShowPM"), _T(""), 1); return 0; } @@ -70,8 +70,8 @@ static INT_PTR CheckDb(WPARAM, LPARAM) PROCESS_INFORMATION pi; STARTUPINFO si = { 0 }; si.cb = sizeof(si); - GetModuleFileName(NULL, mirandaPath, SIZEOF(mirandaPath)); - mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId()); + GetModuleFileName(NULL, mirandaPath, _countof(mirandaPath)); + mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId()); CallService("CloseAction", 0, 0); CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); } @@ -98,7 +98,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) mi.position = -500200000; mi.pszPopupName = LPGEN("Database"); - for (int i = 0; i < SIZEOF(iconList); i++) { + for (int i = 0; i < _countof(iconList); i++) { mi.pszName = iconList[i].szDescr; mi.pszService = iconList[i].szName; mi.icolibItem = iconList[i].hIcolib; @@ -115,7 +115,7 @@ extern "C" __declspec(dllexport) int Load(void) { mir_getLP(&pluginInfo); - Icon_Register(hInst, LPGEN("Profile manager"), iconList, SIZEOF(iconList)); + Icon_Register(hInst, LPGEN("Profile manager"), iconList, _countof(iconList)); CreateServiceFunction(SRV_LOAD_PM, LoadPM); CreateServiceFunction(SRV_CHECK_DB, CheckDb); -- cgit v1.2.3