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/DbEditorPP/src/watchedvars.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/DbEditorPP/src/watchedvars.cpp') diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index b9bc71cefd..a43c1e46c3 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -116,7 +116,7 @@ void addwatchtolist(HWND hwnd, struct DBsetting *lParam) TCHAR data[32], tmp[16], name[NAME_SIZE]; - GetContactName(hContact, NULL, name, SIZEOF(name)); + GetContactName(hContact, NULL, name, _countof(name)); lvItem.pszText = name; index = ListView_InsertItem(hwnd, &lvItem); @@ -321,8 +321,8 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { ItemInfo ii; ii.hContact = (MCONTACT)lvi.lParam; - ListView_GetItemTextA(hwndVars, hti.iItem, 1, ii.module, SIZEOF(ii.module)); - ListView_GetItemTextA(hwndVars, hti.iItem, 2, ii.setting, SIZEOF(ii.setting)); + ListView_GetItemTextA(hwndVars, hti.iItem, 1, ii.module, _countof(ii.module)); + ListView_GetItemTextA(hwndVars, hti.iItem, 2, ii.setting, _countof(ii.setting)); ii.type = FW_SETTINGNAME; SendMessage(hwnd2mainWindow, WM_FINDITEM, (WPARAM)&ii, 0); } @@ -372,17 +372,17 @@ void popupWatchedVar(MCONTACT hContact, const char *module, const char *setting) int timeout = db_get_b(NULL, modname, "PopupDelay", 3); TCHAR name[NAME_SIZE], text[MAX_SECONDLINE], value[MAX_SECONDLINE]; - GetContactName(hContact, NULL, name, SIZEOF(name)); + GetContactName(hContact, NULL, name, _countof(name)); // 2nd line - int type = GetValue(hContact, module, setting, value, SIZEOF(value)); + int type = GetValue(hContact, module, setting, value, _countof(value)); mir_sntprintf(text, TranslateT("Database Setting Changed: \nModule: \"%s\", Setting: \"%s\"\nNew Value (%s): \"%s\""), _A2T(module), _A2T(setting), DBVType(type), value); POPUPDATAT ppd = { 0 }; ppd.lchContact = (MCONTACT)hContact; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT)); - mir_tstrncpy(ppd.lptzContactName, name, SIZEOF(ppd.lptzContactName)); - mir_tstrncpy(ppd.lptzText, text, SIZEOF(ppd.lptzText)); + mir_tstrncpy(ppd.lptzContactName, name, _countof(ppd.lptzContactName)); + mir_tstrncpy(ppd.lptzText, text, _countof(ppd.lptzText)); ppd.colorBack = colorBack; ppd.colorText = colorText; ppd.iSeconds = timeout ? timeout : -1; -- cgit v1.2.3