From 6e2b6b31bae6d69bff5271451e73eb08637b8118 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 2 Dec 2014 03:47:27 +0000 Subject: mir_sntprintf(..., _T("%s"), ...) -> _tcsncpy_s(..., ..., _TRUNCATE) fix some x64 ptr truncations git-svn-id: http://svn.miranda-ng.org/main/trunk@11211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_chat.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'protocols/JabberG/src/jabber_chat.cpp') diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 4692566bef..529d78dbfb 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -1202,8 +1202,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* MCONTACT hContact; JABBER_SEARCH_RESULT jsr = { 0 }; jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT); - mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid); - if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) *tmp = 0; + _tcsncpy_s(jsr.jid, him->m_tszRealJid, _TRUNCATE); + if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) + *tmp = 0; JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid); ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority); @@ -1218,8 +1219,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* JABBER_SEARCH_RESULT jsr = { 0 }; jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT); jsr.hdr.flags = PSR_TCHAR; - mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid); - if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) *tmp = 0; + _tcsncpy_s(jsr.jid, him->m_tszRealJid, _TRUNCATE); + if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) + *tmp = 0; jsr.hdr.nick = jsr.jid; ADDCONTACTSTRUCT acs = { 0 }; -- cgit v1.2.3