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 --- protocols/JabberG/src/jabber_groupchat.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/JabberG/src/jabber_groupchat.cpp') diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 14aadd27d8..fb1e164ece 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -369,7 +369,7 @@ static void sttJoinDlgShowRecentItems(HWND hwndDlg, int newCount) RECT rc; int ctrls[] = { IDC_BOOKMARKS, IDOK, IDCANCEL }; - for (int i = 0; i < SIZEOF(ctrls); i++) { + for (int i = 0; i < _countof(ctrls); i++) { GetWindowRect(GetDlgItem(hwndDlg, ctrls[i]), &rc); MapWindowPoints(NULL, hwndDlg, (LPPOINT)&rc, 2); SetWindowPos(GetDlgItem(hwndDlg, ctrls[i]), NULL, rc.left, rc.top + offset, 0, 0, SWP_NOSIZE | SWP_NOZORDER); @@ -466,7 +466,7 @@ void CJabberDlgGcJoin::OnInitDialog() if (!info.loadRecent(i)) break; - mir_sntprintf(jid, SIZEOF(jid), _T("%s@%s (%s)"), + mir_sntprintf(jid, _countof(jid), _T("%s@%s (%s)"), info.room, info.server, info.nick ? info.nick : TranslateT("")); SetDlgItemText(m_hwnd, IDC_RECENT1 + i, jid); @@ -687,18 +687,18 @@ INT_PTR CJabberDlgGcJoin::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) // fall through case IDOK: { - GetDlgItemText(m_hwnd, IDC_SERVER, text, SIZEOF(text)); + GetDlgItemText(m_hwnd, IDC_SERVER, text, _countof(text)); TCHAR *server = NEWTSTR_ALLOCA(text), *room; m_proto->ComboAddRecentString(m_hwnd, IDC_SERVER, "joinWnd_rcSvr", server); - GetDlgItemText(m_hwnd, IDC_ROOM, text, SIZEOF(text)); + GetDlgItemText(m_hwnd, IDC_ROOM, text, _countof(text)); room = NEWTSTR_ALLOCA(text); - GetDlgItemText(m_hwnd, IDC_NICK, text, SIZEOF(text)); + GetDlgItemText(m_hwnd, IDC_NICK, text, _countof(text)); TCHAR *nick = NEWTSTR_ALLOCA(text); - GetDlgItemText(m_hwnd, IDC_PASSWORD, text, SIZEOF(text)); + GetDlgItemText(m_hwnd, IDC_PASSWORD, text, _countof(text)); TCHAR *password = NEWTSTR_ALLOCA(text); m_proto->GroupchatJoinRoom(server, room, nick, password); } @@ -1182,7 +1182,7 @@ public: void OnCommand_Accept(CCtrlButton*) { TCHAR text[128]; - GetDlgItemText(m_hwnd, IDC_NICK, text, SIZEOF(text)); + GetDlgItemText(m_hwnd, IDC_NICK, text, _countof(text)); m_proto->AcceptGroupchatInvite(m_info->roomJid, text, m_info->password); EndDialog(m_hwnd, 0); } -- cgit v1.2.3