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/BuddyExpectator/src/BuddyExpectator.cpp | 10 +++++----- plugins/BuddyExpectator/src/options.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/BuddyExpectator') diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 4a492abff8..9a94559966 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -230,11 +230,11 @@ bool isContactGoneFor(MCONTACT hContact, int days) ppd.lchContact = hContact; ppd.lchIcon = IcoLib_GetIcon("enabled_icon"); - mir_sntprintf(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), TranslateT("Hiding %s (%S)"), + mir_sntprintf(ppd.lptzContactName, _countof(ppd.lptzContactName), TranslateT("Hiding %s (%S)"), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR), GetContactProto(hContact)); - mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage); + mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("%d days since last message"), daysSinceMessage); if (!options.iUsePopupColors) { ppd.colorBack = options.iPopupColorBack; @@ -288,7 +288,7 @@ void ReturnNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); TCHAR tmpMsg[512]; - mir_sntprintf(tmpMsg, SIZEOF(tmpMsg), _T("%s %s"), nick, message); + mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message); cle.ptszTooltip = tmpMsg; CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle); @@ -326,7 +326,7 @@ void GoneNotify(MCONTACT hContact, TCHAR *message) TCHAR* nick = (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); TCHAR tmpMsg[512]; - mir_sntprintf(tmpMsg, SIZEOF(tmpMsg), _T("%s %s"), nick, message); + mir_sntprintf(tmpMsg, _countof(tmpMsg), _T("%s %s"), nick, message); cle.ptszTooltip = tmpMsg; cle.flags = CLEF_TCHAR; @@ -694,7 +694,7 @@ extern "C" int __declspec(dllexport) Load(void) db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time); } - Icon_Register(hInst, "BuddyExpectator", iconList, SIZEOF(iconList)); + Icon_Register(hInst, "BuddyExpectator", iconList, _countof(iconList)); HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 6eed6cc9a9..27337be821 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -327,7 +327,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP ppd.lchIcon = hIcon; _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME); TCHAR szPreviewText[250]; - mir_sntprintf(szPreviewText, SIZEOF(szPreviewText), TranslateT("has returned after being absent since %d days"), rand() % 30); + mir_sntprintf(szPreviewText, _countof(szPreviewText), TranslateT("has returned after being absent since %d days"), rand() % 30); _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE); // Get current popups colors options -- cgit v1.2.3