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/TabSRMM/src/infopanel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'plugins/TabSRMM/src/infopanel.cpp') diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 747e5682bf..97c73680fe 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -496,7 +496,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) time_t diff = time(NULL) - m_dat->idle; int i_hrs = diff / 3600; int i_mins = (diff - i_hrs * 3600) / 60; - mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins); + mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins); } else _tcscpy_s(szBuf, 256, tszUin); @@ -543,7 +543,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) TCHAR szResult[80]; szResult[0] = 0; if (m_dat->hTimeZone) { - TimeZone_PrintDateTime(m_dat->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0); + TimeZone_PrintDateTime(m_dat->hTimeZone, _T("t"), szResult, _countof(szResult), 0); GetTextExtentPoint32(hdc, szResult, (int)mir_tstrlen(szResult), &sTime); } @@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) if (m_height < DEGRADE_THRESHOLD) { TCHAR tszText[2048]; - mir_sntprintf(tszText, SIZEOF(tszText), TranslateT("Topic is: %s"), + mir_sntprintf(tszText, _countof(tszText), TranslateT("Topic is: %s"), si->ptszTopic ? si->ptszTopic : TranslateT("no topic set.")); hOldFont = reinterpret_cast(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN])); @@ -670,7 +670,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SIZE szTitle; TCHAR szPrefix[100]; - mir_sntprintf(szPrefix, SIZEOF(szPrefix), TranslateT("Topic is: %s"), _T("")); + mir_sntprintf(szPrefix, _countof(szPrefix), TranslateT("Topic is: %s"), _T("")); ::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle); mapRealRect(rcItem, m_rcUIN, szTitle); if (m_hoverFlags & HOVER_UIN) @@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_INITDIALOG: { TCHAR tszTitle[100]; - mir_sntprintf(tszTitle, SIZEOF(tszTitle), TranslateT("Set panel visibility for this %s"), + mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("Set panel visibility for this %s"), m_isChat ? TranslateT("chat room") : TranslateT("contact")); ::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle); - mir_sntprintf(tszTitle, SIZEOF(tszTitle), m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") : + mir_sntprintf(tszTitle, _countof(tszTitle), m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") : TranslateT("Do not synchronize the panel height with group chat windows")); ::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle); -- cgit v1.2.3