diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2015-05-22 10:18:21 +0000 |
commit | b499ebc740aa5480be013d40e0d8097066800642 (patch) | |
tree | ed410ee863f4afc0c579599741bf38b4e3ffb706 /protocols | |
parent | 5a17c9299e03bebf46169927abdeee34aaf8e854 (diff) |
replace _tcslen to mir_tstrlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
35 files changed, 81 insertions, 81 deletions
diff --git a/protocols/AimOscar/src/chat.cpp b/protocols/AimOscar/src/chat.cpp index 384a08fa18..73b8a61b91 100644 --- a/protocols/AimOscar/src/chat.cpp +++ b/protocols/AimOscar/src/chat.cpp @@ -122,7 +122,7 @@ int CAimProto::OnGCEvent(WPARAM, LPARAM lParam) break;
case GC_USER_MESSAGE:
- if (gch->ptszText && _tcslen(gch->ptszText))
+ if (gch->ptszText && mir_tstrlen(gch->ptszText))
{
char* msg = mir_utf8encodeT(gch->ptszText);
aim_chat_send_message(item->hconn, item->seqno, msg);
diff --git a/protocols/AimOscar/src/popup.cpp b/protocols/AimOscar/src/popup.cpp index 82ded8680c..61ecaa9d17 100644 --- a/protocols/AimOscar/src/popup.cpp +++ b/protocols/AimOscar/src/popup.cpp @@ -87,7 +87,7 @@ void CAimProto::ShowPopup(const char* msg, int flags, char* url) {
if (flags & MAIL_POPUP)
{
- size_t len = _tcslen(ppd.lptzText);
+ size_t len = mir_tstrlen(ppd.lptzText);
mir_sntprintf(&ppd.lptzText[len], SIZEOF(ppd.lptzText) - len, _T(" %s"), TranslateT("Open mail account?"));
if (MessageBox(NULL, ppd.lptzText, ppd.lptzContactName, MB_YESNO | MB_ICONINFORMATION) == IDYES)
ShellExecuteA(NULL, "open", url, NULL, NULL, SW_SHOW);
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index d68cf33608..fef79cf78c 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -338,7 +338,7 @@ HANDLE __cdecl CAimProto::SearchBasic(const PROTOCHAR* szId) HANDLE __cdecl CAimProto::SearchByEmail(const PROTOCHAR* email)
{
// Maximum email size should really be 320, but the char string is limited to 255.
- if (state != 1 || email == NULL || _tcslen(email) >= 254)
+ if (state != 1 || email == NULL || mir_tstrlen(email) >= 254)
return NULL;
char* szEmail = mir_t2a(email);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index cfbb68266d..c026f4afc6 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -638,7 +638,7 @@ retry: _tcsncpy_s(strFmt2, pcli->pfnGetStatusModeDescription( status_gg2m(atoi(__status)), 0), _TRUNCATE);
if (__city) {
mir_sntprintf(strFmt1, SIZEOF(strFmt1), _T(", %s %s"), TranslateT("City:"), __city);
- _tcsncat(strFmt2, strFmt1, SIZEOF(strFmt2) - _tcslen(strFmt2));
+ _tcsncat(strFmt2, strFmt1, SIZEOF(strFmt2) - mir_tstrlen(strFmt2));
}
if (__birthyear) {
time_t t = time(NULL);
@@ -647,7 +647,7 @@ retry: if (br < (lt->tm_year + 1900) && br > 1900) {
mir_sntprintf(strFmt1, SIZEOF(strFmt1), _T(", %s %d"), TranslateT("Age:"), (lt->tm_year + 1900) - br);
- _tcsncat(strFmt2, strFmt1, SIZEOF(strFmt2) - _tcslen(strFmt2));
+ _tcsncat(strFmt2, strFmt1, SIZEOF(strFmt2) - mir_tstrlen(strFmt2));
}
}
diff --git a/protocols/Gadu-Gadu/src/dialogs.cpp b/protocols/Gadu-Gadu/src/dialogs.cpp index 82a635c024..50616a407b 100644 --- a/protocols/Gadu-Gadu/src/dialogs.cpp +++ b/protocols/Gadu-Gadu/src/dialogs.cpp @@ -832,28 +832,28 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, req = gg_pubdir50_new(GG_PUBDIR50_WRITE); GetDlgItemText(hwndDlg, IDC_FIRSTNAME, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, text_utf8); mir_free(text_utf8); } GetDlgItemText(hwndDlg, IDC_LASTNAME, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, text_utf8); mir_free(text_utf8); } GetDlgItemText(hwndDlg, IDC_NICKNAME, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, text_utf8); mir_free(text_utf8); } GetDlgItemText(hwndDlg, IDC_CITY, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_CITY, text_utf8); mir_free(text_utf8); @@ -872,21 +872,21 @@ static INT_PTR CALLBACK gg_detailsdlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, } GetDlgItemText(hwndDlg, IDC_BIRTHYEAR, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_BIRTHYEAR, text_utf8); mir_free(text_utf8); } GetDlgItemText(hwndDlg, IDC_FAMILYNAME, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_FAMILYNAME, text_utf8); mir_free(text_utf8); } GetDlgItemText(hwndDlg, IDC_CITYORIGIN, text, SIZEOF(text)); - if (_tcslen(text)){ + if (mir_tstrlen(text)){ char* text_utf8 = mir_utf8encodeT(text); gg_pubdir50_add(req, GG_PUBDIR50_FAMILYCITY, text_utf8); mir_free(text_utf8); diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index bb8facc711..9f93b0c6f7 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -405,7 +405,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) // Fetch search data
GetDlgItemText(hwndDlg, IDC_FIRSTNAME, text, SIZEOF(text));
- if (_tcslen(text))
+ if (mir_tstrlen(text))
{
char *firstName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_FIRSTNAME, firstName_utf8);
@@ -415,7 +415,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) /* 1 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_LASTNAME, text, SIZEOF(text));
- if (_tcslen(text))
+ if (mir_tstrlen(text))
{
char *lastName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_LASTNAME, lastName_utf8);
@@ -425,7 +425,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) /* 2 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_NICKNAME, text, SIZEOF(text));
- if (_tcslen(text))
+ if (mir_tstrlen(text))
{
char *nickName_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_NICKNAME, nickName_utf8);
@@ -435,7 +435,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) /* 3 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_CITY, text, SIZEOF(text));
- if (_tcslen(text))
+ if (mir_tstrlen(text))
{
char *city_utf8 = mir_utf8encodeT(text);
gg_pubdir50_add(req, GG_PUBDIR50_CITY, city_utf8);
@@ -445,7 +445,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) /* 4 */ strncat(data, ".", sizeof(data) - mir_strlen(data));
GetDlgItemText(hwndDlg, IDC_AGEFROM, text, SIZEOF(text));
- if (_tcslen(text))
+ if (mir_tstrlen(text))
{
int yearTo = _tstoi(text);
int yearFrom;
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 070f28cb57..5386d62273 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -170,7 +170,7 @@ int GGPROTO::gc_event(WPARAM wParam, LPARAM lParam) gce.ptszNick = nickT;
// Get rid of CRLF at back
- int lc = (int)_tcslen(gch->ptszText) - 1;
+ int lc = (int)mir_tstrlen(gch->ptszText) - 1;
while(lc >= 0 && (gch->ptszText[lc] == '\n' || gch->ptszText[lc] == '\r'))
gch->ptszText[lc --] = 0;
@@ -316,7 +316,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count gcwindow.ptszStatusbarText = status;
// Here we put nice new hash sign
- TCHAR *name = (TCHAR*)calloc(_tcslen(gcwindow.ptszName) + 2, sizeof(TCHAR));
+ TCHAR *name = (TCHAR*)calloc(mir_tstrlen(gcwindow.ptszName) + 2, sizeof(TCHAR));
*name = '#'; _tcscpy(name + 1, gcwindow.ptszName);
gcwindow.ptszName = name;
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 61452bb6fc..a93de45b5a 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -227,10 +227,10 @@ TCHAR *gg_img_getfilter(TCHAR *szFilter, int nSize) // Make up filter
_tcsncpy(pFilter, szFilterName, nSize);
- pFilter += _tcslen(pFilter) + 1;
+ pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
_tcsncpy(pFilter, szFilterMask, nSize - (pFilter - szFilter));
- pFilter += _tcslen(pFilter) + 1;
+ pFilter += mir_tstrlen(pFilter) + 1;
if (pFilter >= szFilter + nSize) return NULL;
*pFilter = 0;
@@ -787,7 +787,7 @@ TCHAR *gg_img_hasextension(TCHAR *filename) TCHAR *imgtype = _tcsrchr(filename, '.');
if (imgtype != NULL)
{
- size_t len = _tcslen(imgtype);
+ size_t len = mir_tstrlen(imgtype);
imgtype++;
if (len == 4 && (_tcsicmp(imgtype, _T("bmp")) == 0 ||
_tcsicmp(imgtype, _T("gif")) == 0 ||
@@ -818,7 +818,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) }
else {
_tcscpy(szPath, path);
- tPathLen = _tcslen(szPath);
+ tPathLen = mir_tstrlen(szPath);
}
if ( _taccess(szPath, 0)){
@@ -835,7 +835,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) mir_sntprintf(szPath + tPathLen, MAX_PATH - tPathLen, _T("\\%s"), dat->lpszFileName);
if ((pImgext = gg_img_hasextension(szPath)) == NULL)
- pImgext = szPath + _tcslen(szPath);
+ pImgext = szPath + mir_tstrlen(szPath);
_tcsncpy_s(imgext, pImgext, _TRUNCATE);
for (i = 1; ; ++i)
{
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 536da7cb30..9a7a880e50 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -337,24 +337,24 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) OPENFILENAME ofn = {0};
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
_tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
- _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - _tcslen(filter));
- pfilter = filter + _tcslen(filter) + 1;
+ _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
+ pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
- _tcsncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - _tcslen(pfilter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ _tcsncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
@@ -404,25 +404,25 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) TCHAR filter[512], *pfilter;
_tcsncpy(str, TranslateT("contacts"), SIZEOF(str));
- _tcsncat(str, _T(".txt"), SIZEOF(str) - _tcslen(str));
+ _tcsncat(str, _T(".txt"), SIZEOF(str) - mir_tstrlen(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
_tcsncpy(filter, TranslateT("Text files"), SIZEOF(filter));
- _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - _tcslen(filter));
- pfilter = filter + _tcslen(filter) + 1;
+ _tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
+ pfilter = filter + mir_tstrlen(filter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, _T("*.TXT"), SIZEOF(filter) - (pfilter - filter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - (pfilter - filter));
- _tcsncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - _tcslen(pfilter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ _tcsncat(pfilter, _T(" (*)"), SIZEOF(filter) - (pfilter - filter) - mir_tstrlen(pfilter));
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
_tcsncpy(pfilter, _T("*"), SIZEOF(filter) - (pfilter - filter));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
if (pfilter >= filter + SIZEOF(filter))
return 0;
*pfilter = '\0';
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index be57b3020f..1d8994cc44 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -193,7 +193,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) //directly check if contact has protected user avatar set by AVS, and if yes return it as protocol avatar
DBVARIANT dbv;
if (!db_get_ts(pai->hContact, "ContactPhoto", "Backup", &dbv)) {
- if ((_tcslen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)){
+ if ((mir_tstrlen(dbv.ptszVal)>0) && db_get_b(pai->hContact, "ContactPhoto", "Locked", 0)){
debugLogA("getavatarinfo(): Incoming request for avatar information. Contact has assigned Locked ContactPhoto. return GAIR_SUCCESS");
_tcscpy_s(pai->filename, SIZEOF(pai->filename) ,dbv.ptszVal);
pai->format = ProtoGetAvatarFormat(pai->filename);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index e7582fe1a9..24f51da361 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -62,7 +62,7 @@ void CIrcProto::ReadSettings(TDbSetting* sets, int count) case DBVT_TCHAR:
if (!getTString(p->name, &dbv)) {
if (p->size != -1) {
- size_t len = min(p->size - 1, _tcslen(dbv.ptszVal));
+ size_t len = min(p->size - 1, mir_tstrlen(dbv.ptszVal));
memcpy(ptr, dbv.pszVal, len*sizeof(TCHAR));
*(TCHAR*)&ptr[len*sizeof(TCHAR)] = 0;
}
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp index aaab23b6f8..7b1cfe11ff 100644 --- a/protocols/JabberG/src/jabber_caps.cpp +++ b/protocols/JabberG/src/jabber_caps.cpp @@ -671,7 +671,7 @@ BOOL CJabberClientCapsManager::HandleInfoRequest(HXML, CJabberIqInfo *pInfo, con mir_tstrncpy(szOsBuffer, _T(""), SIZEOF(szOsBuffer));
else {
TCHAR *szOsWindows = _T("Microsoft Windows");
- size_t nOsWindowsLength = _tcslen(szOsWindows);
+ size_t nOsWindowsLength = mir_tstrlen(szOsWindows);
if (!_tcsnicmp(szOsBuffer, szOsWindows, nOsWindowsLength))
os += nOsWindowsLength + 1;
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index db1e38287b..c156b2b0dc 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -456,7 +456,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) }
else {
sttBrowseMode = SD_BROWSE_NORMAL;
- CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(szJid, _tcslen(szNode) ? szNode : NULL, NULL);
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(szJid, mir_tstrlen(szNode) ? szNode : NULL, NULL);
SendBothRequests(pNode, NULL);
}
lck.unlock();
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp index 7d1fc2de63..0da167336d 100644 --- a/protocols/JabberG/src/jabber_form.cpp +++ b/protocols/JabberG/src/jabber_form.cpp @@ -485,7 +485,7 @@ void JabberFormCreateUI(HWND hwndStatic, HXML xNode, int *formHeight, BOOL bComp if (!v)
break;
if (xmlGetName(v) && !mir_tstrcmp(xmlGetName(v), _T("value")) && xmlGetText(v))
- size += _tcslen(xmlGetText(v)) + 2;
+ size += mir_tstrlen(xmlGetText(v)) + 2;
}
valueStr = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
valueStr[0] = '\0';
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index db120aa0de..65fbced241 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -1080,7 +1080,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node) if (resource == NULL)
gcd.iType = GC_EVENT_INFORMATION;
- else if (_tcsncmp(msgText, _T("/me "), 4) == 0 && _tcslen(msgText) > 4) {
+ else if (_tcsncmp(msgText, _T("/me "), 4) == 0 && mir_tstrlen(msgText) > 4) {
msgText += 4;
gcd.iType = GC_EVENT_ACTION;
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index c382e37d38..c8222b05d7 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -305,7 +305,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) // Include service pack (if any) and build number.
- if (_tcslen(osvi.szCSDVersion) > 0) {
+ if (mir_tstrlen(osvi.szCSDVersion) > 0) {
StringCchCat(pszOS, BUFSIZE, TEXT(" "));
StringCchCat(pszOS, BUFSIZE, osvi.szCSDVersion);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 0000b7b6d1..3567c46592 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -403,8 +403,8 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo *pInfo) TCHAR *szPos = NULL;
while (szPos = _tcsstr(item->group, szGroupDelimeter)) {
*szPos = 0;
- szPos += _tcslen(szGroupDelimeter);
- TCHAR *szNewGroup = (TCHAR *)mir_alloc(sizeof(TCHAR) * (_tcslen(item->group) + _tcslen(szPos) + 2));
+ szPos += mir_tstrlen(szGroupDelimeter);
+ TCHAR *szNewGroup = (TCHAR *)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(item->group) + mir_tstrlen(szPos) + 2));
_tcscpy(szNewGroup, item->group);
_tcscat(szNewGroup, _T("\\"));
_tcscat(szNewGroup, szPos);
@@ -680,7 +680,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) return;
}
- size_t len = _tcslen(m_szJabberJID);
+ size_t len = mir_tstrlen(m_szJabberJID);
if (!_tcsnicmp(jid, m_szJabberJID, len) && (jid[len] == '/' || jid[len] == '\0')) {
hContact = NULL;
debugLogA("Vcard for myself");
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 5159477d75..7072c507db 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -119,14 +119,14 @@ MCONTACT CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL *q = '/';
// We can't use JabberHContactFromJID() here because of the stripResource option
- size_t len = _tcslen(s);
+ size_t len = mir_tstrlen(s);
for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
ptrT jid( getTStringA(hContact, "jid"));
if (jid == NULL)
continue;
TCHAR *p = jid;
- if (p && _tcslen(p) >= len && (p[len]=='\0'||p[len]=='/') && !_tcsnicmp(p, s, len))
+ if (p && mir_tstrlen(p) >= len && (p[len]=='\0'||p[len]=='/') && !_tcsnicmp(p, s, len))
return hContact;
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 4116d1ac6b..6b08ffc451 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1088,9 +1088,9 @@ void CJabberProto::_RosterHandleGetRequest(HXML node, CJabberIqInfo*) }
if (bPushed) {
HXML item = query << XCHILD(_T("item"));
- if (_tcslen(group))
+ if (mir_tstrlen(group))
item << XCHILD(_T("group"), group);
- if (_tcslen(name))
+ if (mir_tstrlen(name))
item << XATTR(_T("name"), name);
item << XATTR(_T("jid"), jid) << XATTR(_T("subscription"), subscr[0] ? subscr : _T("none"));
itemCount++;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index f20c678d00..dbaea138f8 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -1016,17 +1016,17 @@ void CJabberDlgPrivacyLists::ShowAdvancedList(CPrivacyList *pList) if (dwPackets & JABBER_PL_RULE_TYPE_MESSAGE)
_tcscat(szPackets, _T("messages"));
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_IN) {
- if (_tcslen(szPackets))
+ if (mir_tstrlen(szPackets))
_tcscat(szPackets, _T(", "));
_tcscat(szPackets, _T("presence-in"));
}
if (dwPackets & JABBER_PL_RULE_TYPE_PRESENCE_OUT) {
- if (_tcslen(szPackets))
+ if (mir_tstrlen(szPackets))
_tcscat(szPackets, _T(", "));
_tcscat(szPackets, _T("presence-out"));
}
if (dwPackets & JABBER_PL_RULE_TYPE_IQ) {
- if (_tcslen(szPackets))
+ if (mir_tstrlen(szPackets))
_tcscat(szPackets, _T(", "));
_tcscat(szPackets, _T("queries"));
}
@@ -1837,7 +1837,7 @@ void CJabberDlgPrivacyLists::btnAddList_OnClick(CCtrlButton*) // FIXME: line length is hard coded in dialog procedure
CJabberDlgPrivacyAddList dlgPrivacyAddList(m_proto, m_hwnd);
int nRetVal = dlgPrivacyAddList.DoModal();
- if (nRetVal && _tcslen(dlgPrivacyAddList.szLine)) {
+ if (nRetVal && mir_tstrlen(dlgPrivacyAddList.szLine)) {
mir_cslockfull lck(m_proto->m_privacyListManager.m_cs);
CPrivacyList *pList = m_proto->m_privacyListManager.FindList(dlgPrivacyAddList.szLine);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 0df2add95a..a471b49703 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -471,7 +471,7 @@ HANDLE __cdecl CJabberProto::FileAllow(MCONTACT /*hContact*/, HANDLE hTransfer, filetransfer *ft = (filetransfer*)hTransfer;
ft->std.tszWorkingDir = mir_tstrdup(szPath);
- size_t len = _tcslen(ft->std.tszWorkingDir)-1;
+ size_t len = mir_tstrlen(ft->std.tszWorkingDir)-1;
if (ft->std.tszWorkingDir[len] == '/' || ft->std.tszWorkingDir[len] == '\\')
ft->std.tszWorkingDir[len] = 0;
@@ -623,7 +623,7 @@ int __cdecl CJabberProto::GetInfo(MCONTACT hContact, int /*infoType*/) bool bHasResource = _tcscmp(jid, szBareJid) != 0;
JABBER_LIST_ITEM *tmpItem = NULL;
if (bHasResource && (tmpItem = ListGetItemPtr(LIST_CHATROOM, szBareJid))) {
- pResourceStatus him(tmpItem->findResource(szBareJid+_tcslen(szBareJid)+1));
+ pResourceStatus him(tmpItem->findResource(szBareJid+mir_tstrlen(szBareJid)+1));
if (him) {
item = ListAdd(LIST_VCARD_TEMP, jid);
ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
@@ -1143,7 +1143,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void *param) JABBER_RESOURCE_STATUS *r = item->arResources[i];
if (r->m_tszStatusMessage) {
msgCount++;
- len += (_tcslen(r->m_tszResourceName) + _tcslen(r->m_tszStatusMessage) + 8);
+ len += (mir_tstrlen(r->m_tszResourceName) + mir_tstrlen(r->m_tszStatusMessage) + 8);
}
}
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index f78b97abe9..968ec55fab 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -347,7 +347,7 @@ static void appendString(bool bIsTipper, const TCHAR *tszTitle, const TCHAR *tsz out.AppendFormat(_T("<b>%s</b>\t%s"), TranslateTS(tszTitle), tszValue);
else {
TCHAR *p = TranslateTS(tszTitle);
- out.AppendFormat(_T("%s%s\t%s"), p, _tcslen(p) <= 7 ? _T("\t") : _T(""), tszValue);
+ out.AppendFormat(_T("%s%s\t%s"), p, mir_tstrlen(p) <= 7 ? _T("\t") : _T(""), tszValue);
}
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 66ef740ca8..7e55a4e57b 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -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) + mir_strlen(info.conn.server) + 1;
+ size_t len = mir_tstrlen(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;
@@ -1066,7 +1066,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) LPCTSTR ptszSubject = xmlGetText(xmlGetChild(node, "subject"));
if (ptszSubject && *ptszSubject) {
- size_t cbLen = (szMessage ? _tcslen(szMessage) : 0) + _tcslen(ptszSubject) + 128;
+ size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszSubject) + 128;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR) * cbLen);
szTmp[0] = 0;
if (szMessage)
@@ -1084,7 +1084,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) if (addressNode) {
const TCHAR *szJid = xmlGetAttrValue(addressNode, _T("jid"));
if (szJid) {
- size_t cbLen = _tcslen(szMessage) + 1000;
+ size_t cbLen = mir_tstrlen(szMessage) + 1000;
TCHAR *p = (TCHAR*)alloca(sizeof(TCHAR) * cbLen);
mir_sntprintf(p, cbLen, TranslateT("Message redirected from: %s\r\n%s"), from, szMessage);
szMessage = p;
@@ -1204,7 +1204,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) TCHAR *prolog = _T("-----BEGIN PGP MESSAGE-----\r\n\r\n");
TCHAR *epilog = _T("\r\n-----END PGP MESSAGE-----\r\n");
- size_t len = _tcslen(prolog) + _tcslen(ptszText) + _tcslen(epilog) + 3;
+ size_t len = mir_tstrlen(prolog) + mir_tstrlen(ptszText) + mir_tstrlen(epilog) + 3;
TCHAR *tempstring = (TCHAR*)_alloca(sizeof(TCHAR)*len);
mir_sntprintf(tempstring, len, _T("%s%s%s"), prolog, ptszText, epilog);
szMessage = tempstring;
@@ -1265,7 +1265,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData *info) else if (!_tcscmp(ptszXmlns, JABBER_FEAT_OOB2)) {
LPCTSTR ptszUrl = xmlGetText(xmlGetChild(xNode, "url"));
if (ptszUrl != NULL && *ptszUrl) {
- size_t cbLen = (szMessage ? _tcslen(szMessage) : 0) + _tcslen(ptszUrl) + 32;
+ size_t cbLen = (szMessage ? mir_tstrlen(szMessage) : 0) + mir_tstrlen(ptszUrl) + 32;
TCHAR *szTmp = (TCHAR *)alloca(sizeof(TCHAR)* cbLen);
_tcscpy(szTmp, ptszUrl);
if (szMessage) {
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 68a08b7449..91cbcd76b9 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -257,7 +257,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti // Idle if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - size_t len = _tcslen(buf); + size_t len = mir_tstrlen(buf); if (len > 0) buf[len-1] = 0; } @@ -366,7 +366,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM JABBER_RESOURCE_STATUS *r = item->getTemp(); if (r->m_dwIdleStartTime > 0) { mir_tstrncpy(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf)); - size_t len = _tcslen(buf); + size_t len = mir_tstrlen(buf); if (len > 0) buf[len-1] = 0; } diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 5416ffa74f..e82202ade2 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -75,7 +75,7 @@ MCONTACT CJabberProto::HContactFromJID(const TCHAR *jid, BOOL bStripResource) if (bIsChat)
result = mir_tstrcmpi(jid, dbJid); // for chat room we have to have full contact matched
else if (TRUE)
- result = _tcsnicmp(jid, dbJid, _tcslen(dbJid));
+ result = _tcsnicmp(jid, dbJid, mir_tstrlen(dbJid));
else
result = JabberCompareJids(jid, dbJid);
}
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 813a6c5cea..616ee41f0f 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -246,7 +246,7 @@ HXML __fastcall xmlGetNthChild(HXML hXml, LPCTSTR tag, int nth) {
int i, num;
- if (!hXml || tag == NULL || _tcslen(tag) <= 0 || nth < 1)
+ if (!hXml || tag == NULL || mir_tstrlen(tag) <= 0 || nth < 1)
return NULL;
num = 1;
diff --git a/protocols/MSN/src/msn_libstr.cpp b/protocols/MSN/src/msn_libstr.cpp index f67299fa4c..c6ed14098e 100644 --- a/protocols/MSN/src/msn_libstr.cpp +++ b/protocols/MSN/src/msn_libstr.cpp @@ -304,7 +304,7 @@ TCHAR* EscapeChatTags(const TCHAR* pszText) if (nChars == 0)
return mir_tstrdup(pszText);
- TCHAR *pszNewText = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(pszText) + 1 + nChars));
+ TCHAR *pszNewText = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(pszText) + 1 + nChars));
if (pszNewText == NULL)
return mir_tstrdup(pszText);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp index fcf168788d..b6e3f3456e 100644 --- a/protocols/MSN/src/msn_misc.cpp +++ b/protocols/MSN/src/msn_misc.cpp @@ -334,7 +334,7 @@ void CMsnProto::MSN_GetCustomSmileyFileName(MCONTACT hContact, TCHAR* pszDest, s }
else {
_tcscpy(pszDest, path);
- tPathLen = _tcslen(pszDest);
+ tPathLen = mir_tstrlen(pszDest);
}
if (hContact != NULL) {
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 8e1eebc17f..c8e01b99c3 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -502,7 +502,7 @@ HANDLE __cdecl CMsnProto::FileAllow(MCONTACT, HANDLE hTransfer, const PROTOCHAR* ft->std.tszWorkingDir = mir_tstrdup(szCurrDir);
}
else {
- size_t len = _tcslen(ft->std.tszWorkingDir) - 1;
+ size_t len = mir_tstrlen(ft->std.tszWorkingDir) - 1;
if (ft->std.tszWorkingDir[len] == '\\')
ft->std.tszWorkingDir[len] = 0;
}
diff --git a/protocols/Sametime/src/sametime_proto.cpp b/protocols/Sametime/src/sametime_proto.cpp index c807697ad1..1b97b982a0 100644 --- a/protocols/Sametime/src/sametime_proto.cpp +++ b/protocols/Sametime/src/sametime_proto.cpp @@ -170,7 +170,7 @@ int CSametimeProto::GetInfo(MCONTACT hContact, int infoType) HANDLE CSametimeProto::SearchBasic(const PROTOCHAR* id)
{
- debugLog(_T("CSametimeProto::SearchBasic() id:len=[%d]"), id == NULL ? -1 : _tcslen(id));
+ debugLog(_T("CSametimeProto::SearchBasic() id:len=[%d]"), id == NULL ? -1 : mir_tstrlen(id));
char* id_utf8 = mir_utf8encodeT(id);
int ret = SearchForUser(id_utf8, FALSE);
mir_free(id_utf8);
@@ -183,7 +183,7 @@ HWND CSametimeProto::SearchAdvanced(HWND owner) TCHAR buf[512];
int ret = 0;
if (GetDlgItemText(owner, IDC_EDIT1, buf, SIZEOF(buf))) {
- debugLog(_T("CSametimeProto::SearchAdvanced() buf:len=[%d]"), buf == NULL ? -1 : _tcslen(buf));
+ debugLog(_T("CSametimeProto::SearchAdvanced() buf:len=[%d]"), buf == NULL ? -1 : mir_tstrlen(buf));
char* buf_utf8 = mir_utf8encodeT(buf);
ret = SearchForUser(buf_utf8, TRUE);
mir_free(buf_utf8);
@@ -303,7 +303,7 @@ int CSametimeProto::RecvAwayMsg(MCONTACT hContact, int mode, PROTORECVEVENT* evt int CSametimeProto::SetAwayMsg(int iStatus, const PROTOCHAR* msg)
{
- debugLog(_T("CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]"), iStatus, msg == NULL ? -1 : _tcslen(msg));
+ debugLog(_T("CSametimeProto::SetAwayMsg() iStatus=[%d], msg:len=[%d]"), iStatus, msg == NULL ? -1 : mir_tstrlen(msg));
SetSessionAwayMessage(iStatus, msg);
return 0;
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 871baf250b..3adfbdf8ec 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -317,7 +317,7 @@ int CSametimeProto::SetIdle(bool idle) void CSametimeProto::SetSessionAwayMessage(int status, const PROTOCHAR* msgT)
{
- debugLog(_T("SetSessionAwayMessage() status=[%d], msgT:len=[%d]"), status, msgT == NULL ? -1 : _tcslen(msgT));
+ debugLog(_T("SetSessionAwayMessage() status=[%d], msgT:len=[%d]"), status, msgT == NULL ? -1 : mir_tstrlen(msgT));
ptrA msg(mir_utf8encodeT(msgT));
if (status == ID_STATUS_ONLINE)
diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp index 93ad849677..55865b0c2a 100644 --- a/protocols/SkypeClassic/src/gchat.cpp +++ b/protocols/SkypeClassic/src/gchat.cpp @@ -613,13 +613,13 @@ int GCEventHook(WPARAM,LPARAM lParam) { break; } case GC_USER_MESSAGE: - if(gch->ptszText && _tcslen(gch->ptszText) > 0) { + if(gch->ptszText && mir_tstrlen(gch->ptszText) > 0) { DBVARIANT dbv, dbv2; CCSDATA ccs = {0}; TCHAR *pEnd; // remove the ending linebreak - for (pEnd = &gch->ptszText[_tcslen(gch->ptszText) - 1]; + for (pEnd = &gch->ptszText[mir_tstrlen(gch->ptszText) - 1]; *pEnd==_T('\r') || *pEnd==_T('\n'); pEnd--) *pEnd=0; // Send message to the chat-contact if (ccs.hContact = find_chat(gch->pDest->ptszID)) { @@ -633,7 +633,7 @@ int GCEventHook(WPARAM,LPARAM lParam) { // Add our line to the chatlog GCDEST gcd = { gch->pDest->pszModule, gch->pDest->ptszID, 0 }; GCEVENT gce = { sizeof(gce), &gcd }; - if ( _tcsncmp(gch->ptszText, _T("/me "), 4)==0 && _tcslen(gch->ptszText)>4) { + if ( _tcsncmp(gch->ptszText, _T("/me "), 4)==0 && mir_tstrlen(gch->ptszText)>4) { gce.ptszText = gch->ptszText+4; gcd.iType = GC_EVENT_ACTION; } diff --git a/protocols/Xfire/src/Xfire_base.cpp b/protocols/Xfire/src/Xfire_base.cpp index a3247c4301..25990abac9 100644 --- a/protocols/Xfire/src/Xfire_base.cpp +++ b/protocols/Xfire/src/Xfire_base.cpp @@ -40,7 +40,7 @@ void Xfire_base::strtolowerT(TCHAR*str) return;
//lowercase it :)
- for (unsigned int i = 0; i < (int)_tcslen(str); i++)
+ for (unsigned int i = 0; i < (int)mir_tstrlen(str); i++)
{
str[i] = tolower(str[i]);
}
diff --git a/protocols/Xfire/src/tools.cpp b/protocols/Xfire/src/tools.cpp index f2783b6be3..38dcb396e8 100644 --- a/protocols/Xfire/src/tools.cpp +++ b/protocols/Xfire/src/tools.cpp @@ -270,7 +270,7 @@ BOOL FindTeamSpeak(DWORD*pid, int*vid) { while (Process32Next(hSnapShot, processInfo) != FALSE) { if (processInfo->th32ProcessID != 0) { - int size = _tcslen(processInfo->szExeFile); + int size = mir_tstrlen(processInfo->szExeFile); if (size == 13) { diff --git a/protocols/Yahoo/src/file_transfer.cpp b/protocols/Yahoo/src/file_transfer.cpp index 21faa232d1..08a884023d 100644 --- a/protocols/Yahoo/src/file_transfer.cpp +++ b/protocols/Yahoo/src/file_transfer.cpp @@ -733,7 +733,7 @@ HANDLE __cdecl CYahooProto::FileAllow(MCONTACT hContact, HANDLE hTransfer, const //LOG(LOG_INFO, "[%s] Requesting file from %s", ft->cookie, ft->user);
ft->pfts.tszWorkingDir = _tcsdup( szPath );
- size_t len = _tcslen(ft->pfts.tszWorkingDir) - 1;
+ size_t len = mir_tstrlen(ft->pfts.tszWorkingDir) - 1;
if (ft->pfts.tszWorkingDir[len] == '\\')
ft->pfts.tszWorkingDir[len] = 0;
|