From 4c814798c7bc7f6a0f92c21b027b26290622aa2f Mon Sep 17 00:00:00 2001 From: George Hazan <george.hazan@gmail.com> 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/YahooGroups/src/services.cpp | 2 +- plugins/YahooGroups/src/utils.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/YahooGroups') diff --git a/plugins/YahooGroups/src/services.cpp b/plugins/YahooGroups/src/services.cpp index fe79736be4..8bb381621f 100644 --- a/plugins/YahooGroups/src/services.cpp +++ b/plugins/YahooGroups/src/services.cpp @@ -95,7 +95,7 @@ void AddNewGroup(const char *newGroup) char group[1024]; *group = 1; - strncpy_s((group + 1), (SIZEOF(group) - 1), newGroup, _TRUNCATE); + strncpy_s((group + 1), (_countof(group) - 1), newGroup, _TRUNCATE); mir_snprintf(tmp, "%d", index); const int MAX_SIZE = 1024; diff --git a/plugins/YahooGroups/src/utils.cpp b/plugins/YahooGroups/src/utils.cpp index 9f6f63d865..f4dd3fd7c1 100644 --- a/plugins/YahooGroups/src/utils.cpp +++ b/plugins/YahooGroups/src/utils.cpp @@ -271,7 +271,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) { case CNFT_BYTE: { - mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.bVal); + mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.bVal); buffer = _tcsdup(tmp); break; @@ -279,7 +279,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_WORD: { - mir_sntprintf(tmp, SIZEOF(tmp), _T("%d"), ctInfo.wVal); + mir_sntprintf(tmp, _countof(tmp), _T("%d"), ctInfo.wVal); buffer = _tcsdup(tmp); break; @@ -287,7 +287,7 @@ TCHAR *GetContactID(MCONTACT hContact, char *szProto) case CNFT_DWORD: { - mir_sntprintf(tmp, SIZEOF(tmp), _T("%ld"), ctInfo.dVal); + mir_sntprintf(tmp, _countof(tmp), _T("%ld"), ctInfo.dVal); buffer = _tcsdup(tmp); break; @@ -327,7 +327,7 @@ MCONTACT GetContactFromID(TCHAR *szID, char *szProto) szHandle = GetContactID(hContact, cProtocol); tmp = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR); - _tcsncpy(dispName, tmp, SIZEOF(dispName)); + _tcsncpy(dispName, tmp, _countof(dispName)); if ((szHandle) && ((mir_tstrcmpi(szHandle, szID) == 0) || (mir_tstrcmpi(dispName, szID) == 0)) && ((szProto == NULL) || (_stricmp(szProto, cProtocol) == 0))) found = 1; -- cgit v1.2.3