summaryrefslogtreecommitdiff
path: root/plugins/AutoRun/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-19 19:35:42 +0000
commit4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch)
tree9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/AutoRun/src
parentf0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (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/AutoRun/src')
-rw-r--r--plugins/AutoRun/src/main.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp
index 6c2c6383af..6291410e60 100644
--- a/plugins/AutoRun/src/main.cpp
+++ b/plugins/AutoRun/src/main.cpp
@@ -27,8 +27,8 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
void GetProfilePath(TCHAR *res, size_t resLen)
{
TCHAR dbname[MAX_PATH], exename[MAX_PATH];
- CallService(MS_DB_GETPROFILENAMET, SIZEOF(dbname), (LPARAM)dbname);
- GetModuleFileName(NULL, exename, SIZEOF(exename));
+ CallService(MS_DB_GETPROFILENAMET, _countof(dbname), (LPARAM)dbname);
+ GetModuleFileName(NULL, exename, _countof(exename));
TCHAR *p = _tcsrchr(dbname, '.');
if (p) *p = 0;
@@ -44,7 +44,7 @@ static void SetAutorun(BOOL autorun)
case TRUE:
if ( RegCreateKeyEx(ROOT_KEY, SUB_KEY, 0, NULL, 0, KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS) {
TCHAR result[MAX_PATH];
- GetProfilePath(result, SIZEOF(result));
+ GetProfilePath(result, _countof(result));
RegSetValueEx(hKey, _T("MirandaNG"), 0, REG_SZ, (BYTE*)result, sizeof(TCHAR)*mir_tstrlen(result));
RegCloseKey(hKey);
}
@@ -69,7 +69,7 @@ static BOOL CmpCurrentAndRegistry()
if ( RegQueryValueEx(hKey, _T("MirandaNG"), NULL, NULL, (LPBYTE)dbpath, &dwBufLen) != ERROR_SUCCESS)
return FALSE;
- GetProfilePath(result, SIZEOF(result));
+ GetProfilePath(result, _countof(result));
return mir_tstrcmpi(result, dbpath) == 0;
}