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/AutoRun/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/AutoRun/src') 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; } -- cgit v1.2.3