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/ProfileManager | |
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/ProfileManager')
-rw-r--r-- | plugins/ProfileManager/src/pmanagerEx.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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);
|