diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-02 03:47:27 +0000 |
commit | 6e2b6b31bae6d69bff5271451e73eb08637b8118 (patch) | |
tree | ca636f1497e4cc6980736d56a7ff61e3a6f88079 /protocols/JabberG/src/jabber_chat.cpp | |
parent | d83beb598f0944dcb944524b1d27525dc320cf18 (diff) |
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
Diffstat (limited to 'protocols/JabberG/src/jabber_chat.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_chat.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
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 };
|