summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:06:32 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:06:32 +0000
commit5a17c9299e03bebf46169927abdeee34aaf8e854 (patch)
treecbd13080f33ac0b6396b9d3b8ba31a3c98de59f8 /protocols/JabberG
parented64312924e77707e7e5b5965c301692519f293a (diff)
replace strlen to mir_strlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp2
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp4
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp8
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp6
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp2
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp2
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp26
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_secur.cpp28
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp12
-rw-r--r--protocols/JabberG/src/jabber_util.cpp2
11 files changed, 47 insertions, 47 deletions
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 8b23af83a5..18fbec6911 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -293,7 +293,7 @@ void CJabberProto::OnIqResultGetCollection(HXML iqNode, CJabberIqInfo*)
DBEVENTINFO dbei = { sizeof(DBEVENTINFO) };
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.szModule = m_szModuleName;
- dbei.cbBlob = (DWORD)strlen(szEventText);
+ dbei.cbBlob = (DWORD)mir_strlen(szEventText);
dbei.flags = DBEF_READ + DBEF_UTF + from;
dbei.pBlob = (PBYTE)(char*)szEventText;
dbei.timestamp = tmStart + _ttol(tszSecs) - timezone;
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 457b0bbde9..150b22e5d4 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -469,7 +469,7 @@ void CJabberInfoFrame::UpdateInfoItem(char *pszName, HANDLE hIcolibIcon, TCHAR *
void CJabberInfoFrame::ShowInfoItem(char *pszName, bool bShow)
{
bool bUpdate = false;
- size_t length = strlen(pszName);
+ size_t length = mir_strlen(pszName);
for (int i=0; i < m_pItems.getCount(); i++)
if ((m_pItems[i].m_bShow != bShow) && !strncmp(m_pItems[i].m_pszName, pszName, length)) {
m_pItems[i].m_bShow = bShow;
@@ -484,7 +484,7 @@ void CJabberInfoFrame::ShowInfoItem(char *pszName, bool bShow)
void CJabberInfoFrame::RemoveInfoItem(char *pszName)
{
bool bUpdate = false;
- size_t length = strlen(pszName);
+ size_t length = mir_strlen(pszName);
for (int i=0; i < m_pItems.getCount(); i++)
if (!strncmp(m_pItems[i].m_pszName, pszName, length)) {
if (!m_pItems[i].m_bShow) --m_hiddenItemCount;
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index d2923a76d1..5c2715f7bf 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -434,7 +434,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM hContact, LPARAM)
char text[ 256 ];
strcpy(text, m_szModuleName);
- size_t nModuleNameLength = strlen(text);
+ size_t nModuleNameLength = mir_strlen(text);
char* tDest = text + nModuleNameLength;
mi.flags = CMIF_CHILDPOPUP;
@@ -603,7 +603,7 @@ void CJabberProto::MenuInit()
{
char text[200];
strncpy(text, m_szModuleName, sizeof(text)-1);
- char* tDest = text + strlen(text);
+ char* tDest = text + mir_strlen(text);
CLISTMENUITEM mi = { sizeof(mi) };
mi.pszService = text;
@@ -727,7 +727,7 @@ void CJabberProto::MenuInit()
m_hMenuPriorityRoot = Menu_AddProtoMenuItem(&mi);
TCHAR szName[128];
- char srvFce[MAX_PATH + 64], *svcName = srvFce + strlen(m_szModuleName);
+ char srvFce[MAX_PATH + 64], *svcName = srvFce + mir_strlen(m_szModuleName);
mi.pszService = srvFce;
mi.ptszName = szName;
mi.position = 2000040000;
@@ -826,7 +826,7 @@ void CJabberProto::GlobalMenuInit()
char text[200];
strncpy(text, m_szModuleName, sizeof(text) - 1);
- char* tDest = text + strlen(text);
+ char* tDest = text + mir_strlen(text);
HOTKEYDESC hkd = { sizeof(hkd) };
hkd.pszName = text;
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 36156ae559..5159477d75 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -83,14 +83,14 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
dbei.timestamp = (DWORD)time(NULL);
dbei.flags = DBEF_UTF;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
- dbei.cbBlob = (DWORD)(sizeof(DWORD)*2 + strlen(szNick) + strlen(szJid) + 5);
+ dbei.cbBlob = (DWORD)(sizeof(DWORD)*2 + mir_strlen(szNick) + mir_strlen(szJid) + 5);
PBYTE pCurBlob = dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
*((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD);
*((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD);
- strcpy((char*)pCurBlob, szNick); pCurBlob += strlen(szNick)+1;
+ strcpy((char*)pCurBlob, szNick); pCurBlob += mir_strlen(szNick)+1;
*pCurBlob = '\0'; pCurBlob++; //firstName
*pCurBlob = '\0'; pCurBlob++; //lastName
- strcpy((char*)pCurBlob, szJid); pCurBlob += strlen(szJid)+1;
+ strcpy((char*)pCurBlob, szJid); pCurBlob += mir_strlen(szJid)+1;
*pCurBlob = '\0'; //reason
db_event_add(NULL, &dbei);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index bc964b58f1..4116d1ac6b 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -1235,7 +1235,7 @@ void CJabberProto::_RosterExportToFile(HWND hwndDlg)
char *tmp = mir_utf8encodeT(xtmp);
xi.freeMem(xtmp);
- fwrite(tmp, 1, strlen(tmp), fp);
+ fwrite(tmp, 1, mir_strlen(tmp), fp);
mir_free(tmp);
fclose(fp);
}
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index f40f94429f..f20c678d00 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -2121,7 +2121,7 @@ void CJabberProto::BuildPrivacyListsMenu(bool bDeleteOld)
mir_cslock lck(m_privacyListManager.m_cs);
- char srvFce[MAX_PATH + 64], *svcName = srvFce + strlen(m_szModuleName);
+ char srvFce[MAX_PATH + 64], *svcName = srvFce + mir_strlen(m_szModuleName);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 2000040000;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index a7663e7624..0df2add95a 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -365,9 +365,9 @@ MCONTACT __cdecl CJabberProto::AddToListByEvent(int flags, int /*iContact*/, MEV
return NULL;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
TCHAR *newJid = (dbei.flags & DBEF_UTF) ? mir_utf8decodeT(jid) : mir_a2t(jid);
MCONTACT hContact = (MCONTACT)AddToListByJID(newJid, flags);
@@ -396,9 +396,9 @@ int CJabberProto::Authorize(MEVENT hDbEvent)
return 1;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
debugLog(_T("Send 'authorization allowed' to %s"), jid);
@@ -450,9 +450,9 @@ int CJabberProto::AuthDeny(MEVENT hDbEvent, const TCHAR*)
return 1;
char *nick = (char*)(dbei.pBlob + sizeof(DWORD)*2);
- char *firstName = nick + strlen(nick) + 1;
- char *lastName = firstName + strlen(firstName) + 1;
- char *jid = lastName + strlen(lastName) + 1;
+ char *firstName = nick + mir_strlen(nick) + 1;
+ char *lastName = firstName + mir_strlen(firstName) + 1;
+ char *jid = lastName + mir_strlen(lastName) + 1;
debugLogA("Send 'authorization denied' to %s", jid);
@@ -966,11 +966,11 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc)
}
int isEncrypted, id = SerialNext();
- if (!strncmp(pszSrc, PGP_PROLOG, strlen(PGP_PROLOG))) {
+ if (!strncmp(pszSrc, PGP_PROLOG, mir_strlen(PGP_PROLOG))) {
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_s(tempstring, nStrippedLength, pszSrc + strlen(PGP_PROLOG), _TRUNCATE);
+ char *tempstring = (char*)alloca(mir_strlen(pszSrc) + 1);
+ size_t nStrippedLength = mir_strlen(pszSrc) - mir_strlen(PGP_PROLOG) - (szEnd ? mir_strlen(szEnd) : 0);
+ strncpy_s(tempstring, nStrippedLength, pszSrc + mir_strlen(PGP_PROLOG), _TRUNCATE);
tempstring[nStrippedLength] = 0;
pszSrc = tempstring;
isEncrypted = 1;
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 154db21e39..b83d3ef89c 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -580,7 +580,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
HXML addressesNode = msg << XCHILDNS(_T("addresses"), JABBER_FEAT_EXT_ADDRESSING);
TCHAR szOFrom[JABBER_MAX_JID_LEN];
- size_t cbBlob = strlen((LPSTR)dbei.pBlob)+1;
+ size_t cbBlob = mir_strlen((LPSTR)dbei.pBlob)+1;
if (cbBlob < dbei.cbBlob) { // rest of message contains a sender's resource
ptrT szOResource( mir_utf8decodeT((LPSTR)dbei.pBlob + cbBlob+1));
mir_sntprintf(szOFrom, SIZEOF(szOFrom), _T("%s/%s"), tszJid, szOResource);
diff --git a/protocols/JabberG/src/jabber_secur.cpp b/protocols/JabberG/src/jabber_secur.cpp
index d840ddcd89..3d380eb32a 100644
--- a/protocols/JabberG/src/jabber_secur.cpp
+++ b/protocols/JabberG/src/jabber_secur.cpp
@@ -162,37 +162,37 @@ char* TMD5Auth::getChallenge(const TCHAR *challenge)
serv(mir_utf8encode(info->conn.server));
mir_md5_init(&ctx);
- mir_md5_append(&ctx, (BYTE*)(char*)uname, (int)strlen(uname));
+ mir_md5_append(&ctx, (BYTE*)(char*)uname, (int)mir_strlen(uname));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)realm, (int)strlen(realm));
+ mir_md5_append(&ctx, (BYTE*)realm, (int)mir_strlen(realm));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)(char*)passw, (int)strlen(passw));
+ mir_md5_append(&ctx, (BYTE*)(char*)passw, (int)mir_strlen(passw));
mir_md5_finish(&ctx, (BYTE*)hash1);
mir_md5_init(&ctx);
mir_md5_append(&ctx, (BYTE*)hash1, 16);
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)strlen(nonce));
+ mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)strlen(cnonce));
+ mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
mir_md5_finish(&ctx, (BYTE*)hash1);
mir_md5_init(&ctx);
mir_md5_append(&ctx, (BYTE*)"AUTHENTICATE:xmpp/", 18);
- mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)strlen(serv));
+ mir_md5_append(&ctx, (BYTE*)(char*)serv, (int)mir_strlen(serv));
mir_md5_finish(&ctx, (BYTE*)hash2);
mir_md5_init(&ctx);
mir_snprintf(tmpBuf, SIZEOF(tmpBuf), "%08x%08x%08x%08x", htonl(hash1[0]), htonl(hash1[1]), htonl(hash1[2]), htonl(hash1[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
+ mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_append(&ctx, (BYTE*)":", 1);
- mir_md5_append(&ctx, (BYTE*)nonce, (int)strlen(nonce));
+ mir_md5_append(&ctx, (BYTE*)nonce, (int)mir_strlen(nonce));
mir_snprintf(tmpBuf, SIZEOF(tmpBuf), ":%08d:", iCallCount);
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
- mir_md5_append(&ctx, (BYTE*)cnonce, (int)strlen(cnonce));
+ mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
+ mir_md5_append(&ctx, (BYTE*)cnonce, (int)mir_strlen(cnonce));
mir_md5_append(&ctx, (BYTE*)":auth:", 6);
mir_snprintf(tmpBuf, SIZEOF(tmpBuf), "%08x%08x%08x%08x", htonl(hash2[0]), htonl(hash2[1]), htonl(hash2[2]), htonl(hash2[3]));
- mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)strlen(tmpBuf));
+ mir_md5_append(&ctx, (BYTE*)tmpBuf, (int)mir_strlen(tmpBuf));
mir_md5_finish(&ctx, (BYTE*)digest);
char *buf = (char*)alloca(8000);
@@ -249,7 +249,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge)
for (char *p = strtok(NEWSTR_ALLOCA(chl), ","); p != NULL; p = strtok(NULL, ",")) {
if (*p == 'r' && p[1] == '=') { // snonce
- if (strncmp(cnonce, p + 2, strlen(cnonce)))
+ if (strncmp(cnonce, p + 2, mir_strlen(cnonce)))
return NULL;
snonce = mir_strdup(p + 2);
}
@@ -263,7 +263,7 @@ char* TScramAuth::getChallenge(const TCHAR *challenge)
return NULL;
ptrA passw(mir_utf8encodeT(info->conn.password));
- size_t passwLen = strlen(passw);
+ size_t passwLen = mir_strlen(passw);
BYTE saltedPassw[MIR_SHA1_HASH_SIZE];
Hi(saltedPassw, passw, passwLen, salt, saltLen, ind);
@@ -341,7 +341,7 @@ char* TPlainAuth::getInitialRequest()
{
ptrA uname(mir_utf8encodeT(info->conn.username)), passw(mir_utf8encodeT(info->conn.password));
- size_t size = 2 * strlen(uname) + strlen(passw) + strlen(info->conn.server) + 4;
+ size_t size = 2 * mir_strlen(uname) + mir_strlen(passw) + mir_strlen(info->conn.server) + 4;
char *toEncode = (char*)alloca(size);
if (bOld)
size = mir_snprintf(toEncode, size, "%s@%s%c%s%c%s", uname, info->conn.server, 0, uname, 0, passw);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f185af3e33..66ef740ca8 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -206,7 +206,7 @@ void CJabberProto::xmlStreamInitializeNow(ThreadData *info)
LPTSTR xmlQuery = xi.toString(n, NULL);
char* buf = mir_utf8encodeT(xmlQuery);
- int bufLen = (int)strlen(buf);
+ int bufLen = (int)mir_strlen(buf);
if (bufLen > 2) {
strdel(buf + bufLen - 2, 1);
bufLen--;
@@ -392,7 +392,7 @@ LBL_FatalError:
// User may change status to OFFLINE while we are connecting above
if (m_iDesiredStatus != ID_STATUS_OFFLINE || info.bIsReg) {
if (!info.bIsReg) {
- size_t len = _tcslen(info.conn.username) + strlen(info.conn.server) + 1;
+ size_t len = _tcslen(info.conn.username) + mir_strlen(info.conn.server) + 1;
m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len + 1));
mir_sntprintf(m_szJabberJID, len + 1, _T("%s@%S"), info.conn.username, info.conn.server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
@@ -1229,8 +1229,8 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info)
if (xmlGetChild(xNode, "delivered") != NULL || xmlGetChild(xNode, "offline") != NULL) {
int id = -1;
if (idNode != NULL && xmlGetText(idNode) != NULL)
- if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), strlen(JABBER_IQID)))
- id = _ttoi((xmlGetText(idNode)) + strlen(JABBER_IQID));
+ if (!_tcsncmp(xmlGetText(idNode), _T(JABBER_IQID), mir_strlen(JABBER_IQID)))
+ id = _ttoi((xmlGetText(idNode)) + mir_strlen(JABBER_IQID));
if (id != -1)
ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)id, 0);
@@ -1943,7 +1943,7 @@ int ThreadData::send(char* buffer, int bufsize)
return 0;
if (bufsize == -1)
- bufsize = (int)strlen(buffer);
+ bufsize = (int)mir_strlen(buffer);
WaitForSingleObject(iomutex, 6000);
@@ -1988,7 +1988,7 @@ int ThreadData::send(HXML node)
char* utfStr = mir_utf8encodeT(str);
- int result = send(utfStr, (int)strlen(utfStr));
+ int result = send(utfStr, (int)mir_strlen(utfStr));
mir_free(utfStr);
xi.freeMem(str);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 2c7da1dafe..5416ffa74f 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -170,7 +170,7 @@ char* __stdcall JabberSha1(const char *str, JabberShaStrBuf buf)
BYTE digest[MIR_SHA1_HASH_SIZE];
mir_sha1_ctx sha;
mir_sha1_init(&sha);
- mir_sha1_append(&sha, (BYTE*)str, (int)strlen(str));
+ mir_sha1_append(&sha, (BYTE*)str, (int)mir_strlen(str));
mir_sha1_finish(&sha, digest);
bin2hex(digest, sizeof(digest), buf);