From 5a17c9299e03bebf46169927abdeee34aaf8e854 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Fri, 22 May 2015 10:06:32 +0000 Subject: replace strlen to mir_strlen git-svn-id: http://svn.miranda-ng.org/main/trunk@13747 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db3x_mmap/src/dbcontacts.cpp | 2 +- plugins/Db3x_mmap/src/dbcrypt.cpp | 2 +- plugins/Db3x_mmap/src/dbmodulechain.cpp | 2 +- plugins/Db3x_mmap/src/dbsettings.cpp | 24 ++++++++++++------------ plugins/Db3x_mmap/src/dbtool/eventchain.cpp | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) (limited to 'plugins/Db3x_mmap/src') diff --git a/plugins/Db3x_mmap/src/dbcontacts.cpp b/plugins/Db3x_mmap/src/dbcontacts.cpp index b1c842448a..7b93cd2c4a 100644 --- a/plugins/Db3x_mmap/src/dbcontacts.cpp +++ b/plugins/Db3x_mmap/src/dbcontacts.cpp @@ -34,7 +34,7 @@ int CDb3Mmap::CheckProto(DBCachedContact *cc, const char *proto) if (GetContactSettingStatic(cc->contactID, "Protocol", "p", &dbv) != 0 || (dbv.type != DBVT_ASCIIZ)) return 0; - cc->szProto = m_cache->GetCachedSetting(NULL, protobuf, 0, (int)strlen(protobuf)); + cc->szProto = m_cache->GetCachedSetting(NULL, protobuf, 0, (int)mir_strlen(protobuf)); } return !strcmp(cc->szProto, proto); diff --git a/plugins/Db3x_mmap/src/dbcrypt.cpp b/plugins/Db3x_mmap/src/dbcrypt.cpp index 62fdebfb78..fdff3ce5ec 100644 --- a/plugins/Db3x_mmap/src/dbcrypt.cpp +++ b/plugins/Db3x_mmap/src/dbcrypt.cpp @@ -149,7 +149,7 @@ int CDb3Mmap::InitCrypt() DBCONTACTWRITESETTING dbcws = { "CryptoEngine", "Provider" }; dbcws.value.type = DBVT_BLOB; dbcws.value.pbVal = (PBYTE)pProvider->pszName; - dbcws.value.cpbVal = (int)strlen(pProvider->pszName) + 1; + dbcws.value.cpbVal = (int)mir_strlen(pProvider->pszName) + 1; WriteContactSetting(NULL, &dbcws); } else { diff --git a/plugins/Db3x_mmap/src/dbmodulechain.cpp b/plugins/Db3x_mmap/src/dbmodulechain.cpp index ff0b89f704..db5e15ebed 100644 --- a/plugins/Db3x_mmap/src/dbmodulechain.cpp +++ b/plugins/Db3x_mmap/src/dbmodulechain.cpp @@ -86,7 +86,7 @@ DWORD CDb3Mmap::GetModuleNameOfs(const char *szName) if (m_bReadOnly) return 0; - int nameLen = (int)strlen(szName); + int nameLen = (int)mir_strlen(szName); // need to create the module name DWORD ofsNew = CreateNewSpace(nameLen + offsetof(struct DBModuleName, name)); diff --git a/plugins/Db3x_mmap/src/dbsettings.cpp b/plugins/Db3x_mmap/src/dbsettings.cpp index 67bb0d72a2..bf8c494c60 100644 --- a/plugins/Db3x_mmap/src/dbsettings.cpp +++ b/plugins/Db3x_mmap/src/dbsettings.cpp @@ -62,8 +62,8 @@ int CDb3Mmap::GetContactSettingWorker(MCONTACT contactID, LPCSTR szModule, LPCST return 1; // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name - int settingNameLen = (int)strlen(szSetting); - int moduleNameLen = (int)strlen(szModule); + int settingNameLen = (int)mir_strlen(szSetting); + int moduleNameLen = (int)mir_strlen(szModule); if (settingNameLen > 0xFE) { #ifdef _DEBUG OutputDebugStringA("GetContactSettingWorker() got a > 255 setting name length. \n"); @@ -92,7 +92,7 @@ LBL_Seek: if (isStatic) { int cbLen = 0; if (pCachedValue->pszVal != NULL) - cbLen = (int)strlen(pCachedValue->pszVal); + cbLen = (int)mir_strlen(pCachedValue->pszVal); cbOrigLen--; dbv->pszVal = cbOrigPtr; @@ -103,7 +103,7 @@ LBL_Seek: dbv->cchVal = cbLen; } else { - dbv->pszVal = (char*)mir_alloc(strlen(pCachedValue->pszVal) + 1); + dbv->pszVal = (char*)mir_alloc(mir_strlen(pCachedValue->pszVal) + 1); strcpy(dbv->pszVal, pCachedValue->pszVal); } } @@ -237,7 +237,7 @@ LBL_Seek: if (cc && cc->IsMeta() && ValidLookupName(szModule, szSetting)) { if (contactID = db_mc_getDefault(contactID)) { if (szModule = GetContactProto(contactID)) { - moduleNameLen = (int)strlen(szModule); + moduleNameLen = (int)mir_strlen(szModule); goto LBL_Seek; } } @@ -364,7 +364,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::FreeVariant(DBVARIANT *dbv) STDMETHODIMP_(BOOL) CDb3Mmap::SetSettingResident(BOOL bIsResident, const char *pszSettingName) { - char *szSetting = m_cache->GetCachedSetting(NULL, pszSettingName, 0, (int)strlen(pszSettingName)); + char *szSetting = m_cache->GetCachedSetting(NULL, pszSettingName, 0, (int)mir_strlen(pszSettingName)); szSetting[-1] = (char)bIsResident; mir_cslock lck(m_csDbAccess); @@ -385,8 +385,8 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW return 1; // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name - int settingNameLen = (int)strlen(dbcws->szSetting); - int moduleNameLen = (int)strlen(dbcws->szModule); + int settingNameLen = (int)mir_strlen(dbcws->szSetting); + int moduleNameLen = (int)mir_strlen(dbcws->szModule); if (settingNameLen > 0xFE) { #ifdef _DEBUG OutputDebugStringA("WriteContactSetting() got a > 255 setting name length. \n"); @@ -408,7 +408,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW if (val == NULL) return 1; - dbcwNotif.value.pszVal = (char*)alloca(strlen(val) + 1); + dbcwNotif.value.pszVal = (char*)alloca(mir_strlen(val) + 1); strcpy(dbcwNotif.value.pszVal, val); mir_free(val); dbcwNotif.value.type = DBVT_UTF8; @@ -432,7 +432,7 @@ STDMETHODIMP_(BOOL) CDb3Mmap::WriteContactSetting(MCONTACT contactID, DBCONTACTW LBL_WriteString: if (dbcwWork.value.pszVal == NULL) return 1; - dbcwWork.value.cchVal = (WORD)strlen(dbcwWork.value.pszVal); + dbcwWork.value.cchVal = (WORD)mir_strlen(dbcwWork.value.pszVal); if (bIsEncrypted) { size_t len; BYTE *pResult = m_crypto->encodeString(dbcwWork.value.pszVal, &len); @@ -706,8 +706,8 @@ STDMETHODIMP_(BOOL) CDb3Mmap::DeleteContactSetting(MCONTACT contactID, LPCSTR sz return 1; // the db format can't tolerate more than 255 bytes of space (incl. null) for settings+module name - int settingNameLen = (int)strlen(szSetting); - int moduleNameLen = (int)strlen(szModule); + int settingNameLen = (int)mir_strlen(szSetting); + int moduleNameLen = (int)mir_strlen(szModule); if (settingNameLen > 0xFE) { #ifdef _DEBUG OutputDebugStringA("DeleteContactSetting() got a > 255 setting name length. \n"); diff --git a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp index ce0162f7d5..16cbb2d7dc 100644 --- a/plugins/Db3x_mmap/src/dbtool/eventchain.cpp +++ b/plugins/Db3x_mmap/src/dbtool/eventchain.cpp @@ -38,7 +38,7 @@ static DBEvent* dbePrevEvent = NULL; void CDb3Mmap::ConvertOldEvent(DBEvent*& dbei) { - int msglen = (int)strlen((char*)dbei->blob) + 1, msglenW = 0; + int msglen = (int)mir_strlen((char*)dbei->blob) + 1, msglenW = 0; if (msglen != (int)dbei->cbBlob) { int count = ((dbei->cbBlob - msglen) / sizeof(WCHAR)); WCHAR* p = (WCHAR*)&dbei->blob[msglen]; @@ -59,7 +59,7 @@ void CDb3Mmap::ConvertOldEvent(DBEvent*& dbei) if (utf8str == NULL) return; - dbei->cbBlob = (DWORD)strlen(utf8str) + 1; + dbei->cbBlob = (DWORD)mir_strlen(utf8str) + 1; dbei->flags |= DBEF_UTF; if (offsetof(DBEvent, blob) + dbei->cbBlob > memsize) { memsize = offsetof(DBEvent, blob) + dbei->cbBlob; -- cgit v1.2.3