From fc3a4607ee5cfe9e7cfed8d63e2cb1d549f61d92 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Sep 2014 14:06:14 +0000 Subject: _tcsncpy -> _tcsncpy_s; strncpy -> strncpy_s git-svn-id: http://svn.miranda-ng.org/main/trunk@10557 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/JabberG/src/jabber_proto.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'protocols/JabberG/src/jabber_proto.cpp') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index e222a40427..86bb347cd4 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -139,8 +139,6 @@ CJabberProto::CJabberProto(const char *aProtoName, const TCHAR *aUserName) : m_pepServices.insert(new CPepMood(this)); m_pepServices.insert(new CPepActivity(this)); - *m_savedPassword = 0; - db_set_resident(m_szModuleName, "Status"); db_set_resident(m_szModuleName, DBSETTING_DISPLAY_UID); @@ -722,7 +720,7 @@ void __cdecl CJabberProto::BasicSearchThread(JABBER_SEARCH_BASIC *jsb) jsr.hdr.lastName = _T(""); jsr.hdr.id = jsb->jid; - _tcsncpy(jsr.jid, jsb->jid, SIZEOF(jsr.jid)); + _tcsncpy_s(jsr.jid, jsb->jid, SIZEOF(jsr.jid)); jsr.jid[SIZEOF(jsr.jid)-1] = '\0'; ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)jsb->hSearch, (LPARAM)&jsr); @@ -756,10 +754,10 @@ HANDLE __cdecl CJabberProto::SearchBasic(const TCHAR *szJid) } mir_sntprintf(jsb->jid, SIZEOF(jsb->jid), _T("%s@%s"), szJid, szServer); } - else _tcsncpy(jsb->jid, szJid, SIZEOF(jsb->jid)); + else _tcsncpy_s(jsb->jid, szJid, SIZEOF(jsb->jid)); mir_free(szServer); } - else _tcsncpy(jsb->jid, szJid, SIZEOF(jsb->jid)); + else _tcsncpy_s(jsb->jid, szJid, SIZEOF(jsb->jid)); debugLog(_T("Adding '%s' without validation"), jsb->jid); jsb->hSearch = SerialNext(); @@ -1026,7 +1024,7 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int flags, const char* pszS const char* szEnd = strstr(pszSrc, PGP_EPILOG); char* tempstring = (char*)alloca(strlen(pszSrc) + 1); size_t nStrippedLength = strlen(pszSrc) - strlen(PGP_PROLOG) - (szEnd ? strlen(szEnd) : 0); - strncpy(tempstring, pszSrc + strlen(PGP_PROLOG), nStrippedLength); + strncpy_s(tempstring, nStrippedLength, pszSrc + strlen(PGP_PROLOG), _TRUNCATE); tempstring[nStrippedLength] = 0; pszSrc = tempstring; isEncrypted = 1; -- cgit v1.2.3