summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AVS/src/image_utils.cpp2
-rw-r--r--plugins/Alarms/src/alarm_win.cpp2
-rw-r--r--plugins/Alarms/src/alarmlist.cpp2
-rw-r--r--plugins/BasicHistory/src/ExportManager.cpp6
-rw-r--r--plugins/BasicHistory/src/HistoryWindow.cpp4
-rw-r--r--plugins/BasicHistory/src/Options.cpp12
-rw-r--r--plugins/BasicHistory/src/RichHtmlExport.cpp2
-rw-r--r--plugins/BasicHistory/src/Searcher.cpp4
-rw-r--r--plugins/Boltun/src/boltun.cpp8
-rw-r--r--plugins/Boltun/src/config.cpp2
-rw-r--r--plugins/CSList/src/cslist.cpp2
-rw-r--r--plugins/ChangeKeyboardLayout/src/text_operations.cpp30
-rw-r--r--plugins/Clist_nicer/src/config.cpp2
-rw-r--r--plugins/ConnectionNotify/src/ConnectionNotify.cpp4
-rw-r--r--plugins/ConnectionNotify/src/debug.cpp6
-rw-r--r--plugins/CrashDumper/src/utils.cpp2
-rw-r--r--plugins/Db3x_mmap/src/ui.cpp2
-rw-r--r--plugins/DbChecker/src/progress.cpp2
-rw-r--r--plugins/DbChecker/src/selectdb.cpp4
-rw-r--r--plugins/Db_autobackups/src/options.cpp10
-rw-r--r--plugins/Exchange/src/MirandaExchange.cpp14
-rw-r--r--plugins/Exchange/src/emails.cpp2
-rw-r--r--plugins/Exchange/src/utils.cpp4
-rw-r--r--plugins/FTPFileYM/src/job_generic.cpp4
-rw-r--r--plugins/FTPFileYM/src/utils.cpp4
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp2
-rw-r--r--plugins/FloatingContacts/src/thumbs.cpp4
-rw-r--r--plugins/Folders/src/services.cpp4
-rw-r--r--plugins/Folders/src/utils.cpp4
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_dlg.cpp2
-rw-r--r--plugins/HistoryLinkListPlus/src/linklist_fct.cpp4
-rw-r--r--plugins/IEView/src/TemplateHTMLBuilder.cpp2
-rw-r--r--plugins/Import/src/utils.cpp2
-rw-r--r--plugins/KeyboardNotify/src/main.cpp2
-rw-r--r--plugins/KeyboardNotify/src/options.cpp22
-rw-r--r--plugins/LotusNotify/src/LotusNotify.cpp8
-rw-r--r--plugins/MirOTR/src/otr.cpp2
-rw-r--r--plugins/MirOTR/src/utils.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp2
-rw-r--r--plugins/NewEventNotify/src/popup.cpp6
-rw-r--r--plugins/NewXstatusNotify/src/main.cpp2
-rw-r--r--plugins/NewXstatusNotify/src/xstatus.cpp2
-rwxr-xr-xplugins/New_GPG/src/gpg_wrapper.cpp2
-rwxr-xr-xplugins/New_GPG/src/main.cpp18
-rwxr-xr-xplugins/New_GPG/src/messages.cpp10
-rwxr-xr-xplugins/New_GPG/src/options.cpp32
-rwxr-xr-xplugins/New_GPG/src/utilities.cpp36
-rw-r--r--plugins/NotesAndReminders/src/notes.cpp2
-rw-r--r--plugins/NotesAndReminders/src/options.cpp2
-rw-r--r--plugins/QuickMessages/src/Utils.cpp10
-rw-r--r--plugins/QuickMessages/src/main.cpp12
-rw-r--r--plugins/QuickMessages/src/options.cpp16
-rw-r--r--plugins/Quotes/src/QuoteInfoDlg.cpp2
-rw-r--r--plugins/Quotes/src/QuotesProviderGoogleFinance.cpp4
-rw-r--r--plugins/Scriver/src/chat/window.cpp4
-rw-r--r--plugins/Scriver/src/msgwindow.cpp2
-rw-r--r--plugins/SimpleAR/src/Main.cpp4
-rw-r--r--plugins/SimpleStatusMsg/src/main.cpp2
-rw-r--r--plugins/SmileyAdd/src/options.cpp8
-rw-r--r--plugins/Spamotron/src/options.cpp10
-rw-r--r--plugins/Spamotron/src/spamotron.cpp6
-rw-r--r--plugins/Spamotron/src/utils.cpp26
-rw-r--r--plugins/StatusPlugins/KeepStatus/keepstatus.cpp4
-rw-r--r--plugins/StatusPlugins/StartupStatus/profiles.cpp2
-rwxr-xr-xplugins/StopSpamMod/src/utilities.cpp4
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp4
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
-rw-r--r--plugins/TabSRMM/src/utils.cpp4
-rw-r--r--plugins/TipperYM/src/popwin.cpp14
-rw-r--r--plugins/TipperYM/src/skin_parser.cpp2
-rw-r--r--plugins/TipperYM/src/str_utils.cpp2
-rw-r--r--plugins/TipperYM/src/subst.cpp28
-rw-r--r--plugins/TooltipNotify/src/TooltipNotify.cpp4
-rw-r--r--plugins/TooltipNotify/src/Utils.cpp2
-rw-r--r--plugins/TrafficCounter/src/TrafficCounter.cpp2
-rw-r--r--plugins/TrafficCounter/src/misc.cpp16
-rw-r--r--plugins/TrafficCounter/src/options.cpp2
-rw-r--r--plugins/UserGuide/src/main.cpp6
-rw-r--r--plugins/UserInfoEx/src/ctrl_contact.cpp2
-rw-r--r--plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp2
-rw-r--r--plugins/UserInfoEx/src/psp_origin.cpp2
-rw-r--r--plugins/Variables/src/contact.cpp14
-rw-r--r--plugins/Variables/src/help.cpp4
-rw-r--r--plugins/Variables/src/parse_alias.cpp18
-rw-r--r--plugins/Variables/src/parse_external.cpp6
-rw-r--r--plugins/Variables/src/parse_logic.cpp8
-rw-r--r--plugins/Variables/src/parse_math.cpp12
-rw-r--r--plugins/Variables/src/parse_miranda.cpp42
-rw-r--r--plugins/Variables/src/parse_str.cpp114
-rw-r--r--plugins/Variables/src/parse_system.cpp46
-rw-r--r--plugins/Variables/src/parse_variables.cpp4
-rw-r--r--plugins/Variables/src/tokenregister.cpp2
-rw-r--r--plugins/Variables/src/variables.cpp32
-rw-r--r--plugins/Weather/src/weather_contacts.cpp8
-rw-r--r--plugins/Weather/src/weather_conv.cpp10
-rw-r--r--plugins/Weather/src/weather_data.cpp6
-rw-r--r--plugins/Weather/src/weather_ini.cpp6
-rw-r--r--plugins/Weather/src/weather_update.cpp8
-rw-r--r--plugins/WebView/src/webview_alerts.cpp4
-rw-r--r--plugins/WhenWasIt/src/dlg_handlers.cpp4
-rw-r--r--plugins/XSoundNotify/src/options.cpp2
-rw-r--r--plugins/YAMN/src/browser/mailbrowser.cpp8
-rw-r--r--plugins/YAPP/src/popwin.cpp4
-rw-r--r--plugins/YAPP/src/yapp_history_dlg.cpp6
106 files changed, 448 insertions, 448 deletions
diff --git a/plugins/AVS/src/image_utils.cpp b/plugins/AVS/src/image_utils.cpp
index 1f251954ed..f546a252e2 100644
--- a/plugins/AVS/src/image_utils.cpp
+++ b/plugins/AVS/src/image_utils.cpp
@@ -212,7 +212,7 @@ int BmpFilterSaveBitmap(HBITMAP hBmp, const TCHAR *ptszFile, int flags)
if (!PathToAbsoluteT(ptszFile, tszFilename))
_tcsncpy_s(tszFilename, ptszFile, _TRUNCATE);
- if (_tcslen(tszFilename) <= 4)
+ if (mir_tstrlen(tszFilename) <= 4)
return -1;
IMGSRVC_INFO i = { 0 };
diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp
index 9cabb6b70d..092911db54 100644
--- a/plugins/Alarms/src/alarm_win.cpp
+++ b/plugins/Alarms/src/alarm_win.cpp
@@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcAlarm(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
#define AddItem(x) \
mmi.wID++; \
mmi.dwTypeData = TranslateT(x); \
- mmi.cch = ( UINT )_tcslen(mmi.dwTypeData); \
+ mmi.cch = ( UINT )mir_tstrlen(mmi.dwTypeData); \
InsertMenuItem(hMenu, mmi.wID, FALSE, &mmi);
AddItem(LPGEN("5 mins"));
diff --git a/plugins/Alarms/src/alarmlist.cpp b/plugins/Alarms/src/alarmlist.cpp
index cd60fe2a50..71e5171469 100644
--- a/plugins/Alarms/src/alarmlist.cpp
+++ b/plugins/Alarms/src/alarmlist.cpp
@@ -326,7 +326,7 @@ void SaveAlarms() {
mir_snprintf(buff, SIZEOF(buff), "ActionFlags%d", index);
db_set_dw(0, MODULE, buff, i->action);
if (i->action & AAF_COMMAND) {
- if (_tcslen(i->szCommand)) {
+ if (mir_tstrlen(i->szCommand)) {
mir_snprintf(buff, SIZEOF(buff), "ActionCommand%d", index);
db_set_ts(0, MODULE, buff, i->szCommand);
if (mir_tstrlen(i->szCommandParams)) {
diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp
index 734ef0971d..36fc670db7 100644
--- a/plugins/BasicHistory/src/ExportManager.cpp
+++ b/plugins/BasicHistory/src/ExportManager.cpp
@@ -42,15 +42,15 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open)
_tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, SIZEOF(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
- size_t len = _tcslen(filter) + 1;
+ size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, SIZEOF(filter) - len, _T("*.%s"), ext);
- len += _tcslen(filter + len);
+ len += mir_tstrlen(filter + len);
filter[++len] = 0;
TCHAR stzFilePath[1024];
_tcscpy_s(stzFilePath, TranslateT("History"));
_tcscat_s(stzFilePath, _T("."));
_tcscat_s(stzFilePath, ext);
- len = _tcslen(stzFilePath) + 1;
+ len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp
index 74fe25d110..5c18fcf4a5 100644
--- a/plugins/BasicHistory/src/HistoryWindow.cpp
+++ b/plugins/BasicHistory/src/HistoryWindow.cpp
@@ -1488,7 +1488,7 @@ void HistoryWindow::SelectEventGroup(int sel)
}
tmi.printTimeStamp(NULL, data.timestamp, formatDate, str, MAXSELECTSTR, 0);
- *strLen = (unsigned int)_tcslen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutTimestamp : Options::InTimestamp);
@@ -1501,7 +1501,7 @@ void HistoryWindow::SelectEventGroup(int sel)
mir_sntprintf(str, MAXSELECTSTR, _T("%s\n"), myName);
else
mir_sntprintf(str, MAXSELECTSTR, _T("%s\n"), contactName);
- *strLen = (unsigned int)_tcslen(str) * sizeof(TCHAR);
+ *strLen = (unsigned int)mir_tstrlen(str) * sizeof(TCHAR);
TextSelection->SetStart(MAXLONG);
TextSelection->GetFont(&TextFont);
SetFontFromOptions(TextFont, caps, lastMe ? Options::OutName : Options::InName);
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp
index 6307b9bffc..f5994e4d2c 100644
--- a/plugins/BasicHistory/src/Options.cpp
+++ b/plugins/BasicHistory/src/Options.cpp
@@ -806,24 +806,24 @@ bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR*
_tcscpy_s(extUpper, ext);
extUpper[0] = std::toupper(ext[0], loc);
mir_sntprintf(filter, SIZEOF(filter), TranslateT("%s Files (*.%s)"), extUpper, ext);
- size_t len = _tcslen(filter) + 1;
+ size_t len = mir_tstrlen(filter) + 1;
mir_sntprintf(filter + len, SIZEOF(filter) - len, _T("*.%s"), ext);
- len += _tcslen(filter + len) + 1;
+ len += mir_tstrlen(filter + len) + 1;
_tcscpy_s(filter + len, 1024 - len, TranslateT("All Files (*.*)"));
- len += _tcslen(filter + len) + 1;
+ len += mir_tstrlen(filter + len) + 1;
_tcscpy_s(filter + len, 1024 - len, _T("*.*"));
- len += _tcslen(filter + len) + 1;
+ len += mir_tstrlen(filter + len) + 1;
filter[len] = 0;
TCHAR stzFilePath[1024];
Edit_GetText(hwndEdit, stzFilePath, 1023);
if (stzFilePath[0] == 0) {
_tcscpy_s(stzFilePath, defName);
- len = _tcslen(stzFilePath) + 1;
+ len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
else {
- len = _tcslen(stzFilePath) + 1;
+ len = mir_tstrlen(stzFilePath) + 1;
stzFilePath[len] = 0;
}
diff --git a/plugins/BasicHistory/src/RichHtmlExport.cpp b/plugins/BasicHistory/src/RichHtmlExport.cpp
index c9552f7cb8..c3c0cefbc2 100644
--- a/plugins/BasicHistory/src/RichHtmlExport.cpp
+++ b/plugins/BasicHistory/src/RichHtmlExport.cpp
@@ -256,7 +256,7 @@ void IcoSave(const std::wstring &fileName, HICON hicon)
bool DeleteDirectory(LPCTSTR lpszDir, bool noRecycleBin = true)
{
- size_t len = _tcslen(lpszDir);
+ size_t len = mir_tstrlen(lpszDir);
TCHAR *pszFrom = new TCHAR[len+2];
_tcscpy_s(pszFrom, len+2, lpszDir);
pszFrom[len] = 0;
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp
index 6370ce783e..88a7355350 100644
--- a/plugins/BasicHistory/src/Searcher.cpp
+++ b/plugins/BasicHistory/src/Searcher.cpp
@@ -75,7 +75,7 @@ bool Searcher::CompareStr(std::wstring str, TCHAR *strFind)
return str.find(strFind) < str.length();
size_t findid = str.find(strFind);
- size_t findLen = _tcslen(strFind);
+ size_t findLen = mir_tstrlen(strFind);
while(findid < str.length()) {
if ((findid == 0 || std::isspace(str[findid - 1], loc) || std::ispunct(str[findid - 1], loc)) &&
(findid + findLen >= str.length() || std::isspace(str[findid + findLen], loc) || std::ispunct(str[findid + findLen], loc)))
@@ -111,7 +111,7 @@ void Searcher::Find()
}
if (!matchCase) {
std::locale loc;
- std::transform(str, str + _tcslen(str), str, std::bind2nd(std::ptr_fun(mytoupper), &loc));
+ std::transform(str, str + mir_tstrlen(str), str, std::bind2nd(std::ptr_fun(mytoupper), &loc));
}
bool findBack1 = findBack ^ !searchForInMes;
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 13fbecfee9..7a3796ecc9 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -67,11 +67,11 @@ void UpdateEngine()
TCHAR* GetFullName(const TCHAR* filename)
{
- size_t flen = _tcslen(filename);
+ size_t flen = mir_tstrlen(filename);
TCHAR* fullname = const_cast<TCHAR*>(filename);
if (!_tcschr(filename, _T(':')))
{
- size_t plen = _tcslen(path);
+ size_t plen = mir_tstrlen(path);
fullname = new TCHAR[plen + flen + 1];
fullname[0] = NULL;
_tcscat(fullname, path);
@@ -390,8 +390,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
TCHAR* mind = TranslateTS(MIND_FILE_DESC);
TCHAR* anyfile = TranslateTS(ALL_FILES_DESC);
- size_t l = _tcslen(MIND_DIALOG_FILTER)
- + _tcslen(mind) + _tcslen(anyfile);
+ size_t l = mir_tstrlen(MIND_DIALOG_FILTER)
+ + mir_tstrlen(mind) + mir_tstrlen(anyfile);
TCHAR *filt = new TCHAR[l];
mir_sntprintf(filt, l, MIND_DIALOG_FILTER, mind, anyfile);
for (size_t i = 0; i < l; i++)
diff --git a/plugins/Boltun/src/config.cpp b/plugins/Boltun/src/config.cpp
index 40517216c1..c92db86fdf 100644
--- a/plugins/Boltun/src/config.cpp
+++ b/plugins/Boltun/src/config.cpp
@@ -58,7 +58,7 @@ inline TCHAR* GetString(char* key, const TCHAR* def)
inline const TCHAR* SetString(char* key, const TCHAR* value)
{
- size_t len = _tcslen(value) + 1;
+ size_t len = mir_tstrlen(value) + 1;
TCHAR* val = new TCHAR[len];
_tcscpy_s(val, len, value);
db_set_ts(NULL, BOLTUN_KEY, key, val);
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 29de682404..d82121c760 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -533,7 +533,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item)
GetDlgItemText(m_handle, item, ptszInputText, limit + 8);
- if (_tcslen(ptszInputText) > limit)
+ if (mir_tstrlen(ptszInputText) > limit)
{
TCHAR tszPopupTip[MAX_PATH];
EDITBALLOONTIP ebt = { 0 };
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
index 135409e4be..52de730db6 100644
--- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp
+++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
@@ -31,7 +31,7 @@ LPTSTR GeTStringFromStreamData(EditStreamData *esd)
LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
LPTSTR ptszTemp = (TCHAR*)esd->pbBuff;
- for (i = k = 0; i < _tcslen(ptszTemp); i++) {
+ for (i = k = 0; i < mir_tstrlen(ptszTemp); i++) {
if ((ptszTemp[i] == 0x0A) || (ptszTemp[i] == 0x2028))
ptszOutText[k++] = 0x0D;
else if (ptszTemp[i] == 0x0D) {
@@ -52,7 +52,7 @@ BOOL CopyTextToClipboard(LPTSTR ptszText)
return FALSE;
EmptyClipboard();
- HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (_tcslen(ptszText) + 1)*sizeof(TCHAR));
+ HGLOBAL hCopy = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(ptszText) + 1)*sizeof(TCHAR));
_tcscpy((TCHAR*)GlobalLock(hCopy), ptszText);
GlobalUnlock(hCopy);
SetClipboardData(CF_UNICODETEXT, hCopy);
@@ -97,7 +97,7 @@ LPTSTR GenerateLayoutString(HKL hklLayout)
ptszTemp[0] = 0;
DWORD i;
- for (i = 0; i < _tcslen(ptszKeybEng); i++) {
+ for (i = 0; i < mir_tstrlen(ptszKeybEng); i++) {
SHORT shVirtualKey = VkKeyScanEx(ptszKeybEng[i], hklEng);
UINT iScanCode = MapVirtualKeyEx(shVirtualKey & 0x00FF, 0, hklEng);
@@ -141,7 +141,7 @@ LPTSTR ChangeTextCase(LPCTSTR ptszInText)
LPTSTR ptszOutText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
_tcscpy(ptszOutText, ptszInText);
- for (DWORD i = 0; i < _tcslen(ptszInText); i++) {
+ for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
CharUpperBuff(&ptszOutText[i], 1);
if (ptszOutText[i] == ptszInText[i])
CharLowerBuff(&ptszOutText[i], 1);
@@ -162,20 +162,20 @@ LPTSTR ChangeTextLayout(LPCTSTR ptszInText, HKL hklCurLay, HKL hklToLay, BOOL Tw
if (ptszKeybCur == 0 || ptszKeybNext == 0)
return ptszOutText;
- for (DWORD i = 0; i < _tcslen(ptszInText); i++) {
+ for (DWORD i = 0; i < mir_tstrlen(ptszInText); i++) {
BOOL Found = FALSE;
- for (DWORD j = 0; j < _tcslen(ptszKeybCur) && !Found; j++)
+ for (DWORD j = 0; j < mir_tstrlen(ptszKeybCur) && !Found; j++)
if (ptszKeybCur[j] == ptszInText[i]) {
Found = TRUE;
- if (_tcslen(ptszKeybNext) >= j)
+ if (mir_tstrlen(ptszKeybNext) >= j)
ptszOutText[i] = ptszKeybNext[j];
}
if (TwoWay && !Found)
- for (DWORD j = 0; j < _tcslen(ptszKeybNext) && !Found; j++)
+ for (DWORD j = 0; j < mir_tstrlen(ptszKeybNext) && !Found; j++)
if (ptszKeybNext[j] == ptszInText[i]) {
Found = TRUE;
- if (_tcslen(ptszKeybCur) >= j)
+ if (mir_tstrlen(ptszKeybCur) >= j)
ptszOutText[i] = ptszKeybCur[j];
}
}
@@ -188,7 +188,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText)
LPTSTR ptszKeybBuff = ptszLayStrings[0];
DWORD dwMaxSymbols = 0, dwTemp = 0;
- for (DWORD j = 0; j < _tcslen(ptszInText); j++)
+ for (DWORD j = 0; j < mir_tstrlen(ptszInText); j++)
if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwMaxSymbols;
@@ -196,7 +196,7 @@ HKL GetLayoutOfText(LPCTSTR ptszInText)
ptszKeybBuff = ptszLayStrings[i];
DWORD dwCountSymbols = 0;
- for (DWORD j = 0; j<_tcslen(ptszInText); j++)
+ for (DWORD j = 0; j<mir_tstrlen(ptszInText); j++)
if (_tcschr(ptszKeybBuff, ptszInText[j]) != NULL)
++dwCountSymbols;
@@ -339,7 +339,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
if (!IsBadStringPtr(ptszInText, MaxTextSize) && (iRes > 0)) {
crTemp.cpMin = 0;
- crTemp.cpMax = (int)_tcslen(ptszInText);
+ crTemp.cpMax = (int)mir_tstrlen(ptszInText);
}
else {
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
@@ -351,7 +351,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
// Ïîëó÷àåì òåêóùåå ñëîâî
if (CurrentWord) {
for (dwStartWord = crSelection.cpMin; (dwStartWord > 0) && (_tcschr(ptszSeparators, ptszInText[dwStartWord - 1]) == NULL); dwStartWord--);
- for (dwEndWord = crSelection.cpMin; (dwEndWord < (_tcslen(ptszInText))) && (_tcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
+ for (dwEndWord = crSelection.cpMin; (dwEndWord < (mir_tstrlen(ptszInText))) && (_tcschr(ptszSeparators, ptszInText[dwEndWord]) == NULL); dwEndWord++);
crTemp.cpMin = dwStartWord;
crTemp.cpMax = dwEndWord;
@@ -379,7 +379,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
ptszTemp[crTemp.cpMax - crTemp.cpMin] = 0;
_tcscpy(ptszInText, ptszTemp);
- if (_tcslen(ptszInText) == 0) {
+ if (mir_tstrlen(ptszInText) == 0) {
SendMessage(hTextWnd, EM_EXSETSEL, 0, (LPARAM)&crSelection);
SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0);
InvalidateRect(hTextWnd, NULL, FALSE);
@@ -416,7 +416,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
else {
for (i = 0; i < bLayNum; i++)
if (hklLayouts[i] != hklCurLay) {
- if (_tcslen(ptszMBox) != 0)
+ if (mir_tstrlen(ptszMBox) != 0)
_tcscat(ptszMBox, _T("\n\n"));
ptrT ptszTemp(GetShortNameOfLayout(hklLayouts[i]));
_tcscat(ptszMBox, ptszTemp);
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 185affedf0..dbbf58a4ba 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -342,7 +342,7 @@ HMODULE Utils::loadSystemLibrary(const TCHAR* szFilename, bool useGetHandle)
throw(CRTException("Error while loading system library", szFilename));
sysPathName[MAX_PATH - 1] = 0;
- if (_tcslen(sysPathName) + _tcslen(szFilename) >= MAX_PATH)
+ if (mir_tstrlen(sysPathName) + mir_tstrlen(szFilename) >= MAX_PATH)
throw(CRTException("Error while loading system library", szFilename));
mir_tstrcat(sysPathName, szFilename);
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
index 3b8417abfd..32eaf32610 100644
--- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp
+++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp
@@ -75,11 +75,11 @@ BOOL strrep(TCHAR *src, TCHAR *needle, TCHAR *newstring)
_tcsncpy_s(begining, src, pos);
begining[pos] = 0;
- pos = pos + _tcslen(needle);
+ pos = pos + mir_tstrlen(needle);
_tcsncpy_s(tail, src + pos, _TRUNCATE);
begining[pos] = 0;
- pos = mir_sntprintf(src, _tcslen(src), _T("%s%s%s"), begining, newstring, tail);
+ pos = mir_sntprintf(src, mir_tstrlen(src), _T("%s%s%s"), begining, newstring, tail);
return TRUE;
}
diff --git a/plugins/ConnectionNotify/src/debug.cpp b/plugins/ConnectionNotify/src/debug.cpp
index d20d46f314..633a048af4 100644
--- a/plugins/ConnectionNotify/src/debug.cpp
+++ b/plugins/ConnectionNotify/src/debug.cpp
@@ -29,7 +29,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...)
TCHAR* s = va_arg(argptr, TCHAR *);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, s);
_tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)_tcslen(format);
+ j = (int)mir_tstrlen(format);
_tcscat(format, _T(" "));
break;
}
@@ -39,7 +39,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...)
char c = (char)va_arg(argptr, int);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, c);
_tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)_tcslen(format);
+ j = (int)mir_tstrlen(format);
_tcscat(format, _T(" "));
break;
}
@@ -49,7 +49,7 @@ void _OutputDebugString(TCHAR* lpOutputString, ...)
int d = va_arg(argptr, int);
mir_sntprintf(OutMsg, SIZEOF(OutMsg), format, d);
_tcsncpy(format, OutMsg, _countof(OutMsg));
- j = (int)_tcslen(format);
+ j = (int)mir_tstrlen(format);
_tcscat(format, _T(" "));
break;
}
diff --git a/plugins/CrashDumper/src/utils.cpp b/plugins/CrashDumper/src/utils.cpp
index 164e63dfd0..09ea0ed003 100644
--- a/plugins/CrashDumper/src/utils.cpp
+++ b/plugins/CrashDumper/src/utils.cpp
@@ -230,7 +230,7 @@ void GetISO8061Time(SYSTEMTIME *stLocal, LPTSTR lpszString, DWORD dwSize)
if (clsdates) {
GetDateFormat(LOCALE_INVARIANT, 0, stLocal, TEXT("d MMM yyyy"), lpszString, dwSize);
- int dlen = (int)_tcslen(lpszString);
+ int dlen = (int)mir_tstrlen(lpszString);
GetTimeFormat(LOCALE_INVARIANT, 0, stLocal, TEXT(" H:mm:ss"), lpszString + dlen, dwSize - dlen);
}
else {
diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp
index 0e202dc457..d168b99906 100644
--- a/plugins/Db3x_mmap/src/ui.cpp
+++ b/plugins/Db3x_mmap/src/ui.cpp
@@ -202,7 +202,7 @@ static INT_PTR CALLBACK sttChangePassword(HWND hwndDlg, UINT uMsg, WPARAM wParam
case IDOK:
TCHAR buf2[100];
GetDlgItemText(hwndDlg, IDC_USERPASS1, buf2, SIZEOF(buf2));
- if (_tcslen(buf2) < 3) {
+ if (mir_tstrlen(buf2) < 3) {
SetDlgItemText(hwndDlg, IDC_HEADERBAR, TranslateT("Password is too short!"));
goto LBL_Error;
}
diff --git a/plugins/DbChecker/src/progress.cpp b/plugins/DbChecker/src/progress.cpp
index d38b5627ba..562f0cabb4 100644
--- a/plugins/DbChecker/src/progress.cpp
+++ b/plugins/DbChecker/src/progress.cpp
@@ -147,7 +147,7 @@ INT_PTR CALLBACK ProgressDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
break;
}
if (bold) hoFont = (HFONT)SelectObject(dis->hDC, hBoldFont);
- ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)_tcslen(str), NULL);
+ ExtTextOut(dis->hDC, dis->rcItem.left, dis->rcItem.top, ETO_CLIPPED | ETO_OPAQUE, &dis->rcItem, str, (UINT)mir_tstrlen(str), NULL);
if (bold) SelectObject(dis->hDC, hoFont);
}
return TRUE;
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp
index 4eeef524d3..cc51a1a434 100644
--- a/plugins/DbChecker/src/selectdb.cpp
+++ b/plugins/DbChecker/src/selectdb.cpp
@@ -160,7 +160,7 @@ void FindAdd(HWND hdlg, TCHAR *szProfileDir, TCHAR *szPrefix)
TCHAR *addstring(TCHAR *str, TCHAR *add)
{
_tcscpy(str, add);
- return str + _tcslen(add) + 1;
+ return str + mir_tstrlen(add) + 1;
}
INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
@@ -265,7 +265,7 @@ INT_PTR CALLBACK SelectDbDlgProc(HWND hdlg, UINT message, WPARAM wParam, LPARAM
TCHAR *filter, *tmp, *tmp1, *tmp2;
tmp1 = TranslateT("Miranda Databases (*.dat)");
tmp2 = TranslateT("All Files");
- filter = tmp = (TCHAR*)_alloca((_tcslen(tmp1) + _tcslen(tmp2) + 11)*sizeof(TCHAR));
+ filter = tmp = (TCHAR*)_alloca((mir_tstrlen(tmp1) + mir_tstrlen(tmp2) + 11)*sizeof(TCHAR));
tmp = addstring(tmp, tmp1);
tmp = addstring(tmp, _T("*.DAT"));
tmp = addstring(tmp, tmp2);
diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp
index 4c5f399de6..91cdbf8601 100644
--- a/plugins/Db_autobackups/src/options.cpp
+++ b/plugins/Db_autobackups/src/options.cpp
@@ -45,7 +45,7 @@ int LoadOptions(void)
if (!db_get_ts(0, "AutoBackups", "Folder", &dbv)) {
TCHAR *tmp = Utils_ReplaceVarsT(dbv.ptszVal);
- if (_tcslen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(options.folder, dbv.ptszVal, _TRUNCATE);
else
mir_sntprintf(options.folder, SIZEOF(options.folder), _T("%s\\%s"), profilePath, dbv.ptszVal);
@@ -77,8 +77,8 @@ int SaveOptions(void)
db_set_b(0, "AutoBackups", "PeriodType", (BYTE)options.period_type);
mir_sntprintf(prof_dir, SIZEOF(prof_dir), _T("%s\\"), profilePath);
- size_t prof_len = _tcslen(prof_dir);
- size_t opt_len = _tcslen(options.folder);
+ size_t prof_len = mir_tstrlen(prof_dir);
+ size_t opt_len = mir_tstrlen(options.folder);
if (opt_len > prof_len && _tcsncmp(options.folder, prof_dir, prof_len) == 0) {
db_set_ts(0, "AutoBackups", "Folder", (options.folder + prof_len));
@@ -87,7 +87,7 @@ int SaveOptions(void)
db_set_ts(0, "AutoBackups", "Folder", options.folder);
TCHAR *tmp = Utils_ReplaceVarsT(options.folder);
- if (_tcslen(tmp) < 2 || tmp[1] != ':') {
+ if (mir_tstrlen(tmp) < 2 || tmp[1] != ':') {
_tcsncpy_s(prof_dir, options.folder, _TRUNCATE);
mir_sntprintf(options.folder, SIZEOF(options.folder), _T("%s\\%s"), profilePath, prof_dir);
}
@@ -343,7 +343,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
BOOL folder_ok = TRUE;
TCHAR *tmp = Utils_ReplaceVarsT(folder_buff);
- if (_tcslen(tmp) >= 2 && tmp[1] == ':')
+ if (mir_tstrlen(tmp) >= 2 && tmp[1] == ':')
_tcsncpy_s(backupfolder, tmp, _TRUNCATE);
else
mir_sntprintf(backupfolder, SIZEOF(backupfolder), _T("%s\\%s"), profilePath, tmp);
diff --git a/plugins/Exchange/src/MirandaExchange.cpp b/plugins/Exchange/src/MirandaExchange.cpp
index 6d9f455f35..2026967762 100644
--- a/plugins/Exchange/src/MirandaExchange.cpp
+++ b/plugins/Exchange/src/MirandaExchange.cpp
@@ -116,14 +116,14 @@ CKeeper::CKeeper( LPTSTR szSender, LPTSTR szSubject, LPSTR szEntryID)
m_nSizeEntryID = 0 ;
if (NULL != szSender) {
- m_nSizeSender = (UINT)_tcslen(szSender)+1;
+ m_nSizeSender = (UINT)mir_tstrlen(szSender)+1;
m_szSender = new TCHAR[ m_nSizeSender ];
memset(m_szSender, 0, m_nSizeSender * sizeof(TCHAR));
_tcscpy(m_szSender, szSender);
}
if (NULL != szSubject) {
- m_nSizeSubject = (UINT)_tcslen(szSubject) +1;
+ m_nSizeSubject = (UINT)mir_tstrlen(szSubject) +1;
m_szSubject = new TCHAR[m_nSizeSubject];
memset(m_szSubject, 0, m_nSizeSubject * sizeof(TCHAR));
_tcscpy(m_szSubject, szSubject);
@@ -392,7 +392,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
short nSizeOfTCHAR = sizeof( TCHAR );
if (m_szUsername == NULL && NULL != szUsername) {
- nSize = (UINT)_tcslen(szUsername);
+ nSize = (UINT)mir_tstrlen(szUsername);
if (nSize > 0) {
nSize++;
m_szUsername = new TCHAR[nSize];
@@ -402,7 +402,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
}
if (m_szPassword == NULL && NULL != szPassword) {
- nSize = (UINT)_tcslen(szPassword);
+ nSize = (UINT)mir_tstrlen(szPassword);
if (nSize > 0) {
nSize++;
m_szPassword = new TCHAR[nSize];
@@ -412,7 +412,7 @@ HRESULT CMirandaExchange::InitializeAndLogin( LPCTSTR szUsername, LPCTSTR szPass
}
if (m_szExchangeServer == NULL && NULL != szExchangeServer) {
- nSize = (UINT)_tcslen(szExchangeServer);
+ nSize = (UINT)mir_tstrlen(szExchangeServer);
if (nSize > 0) {
nSize++;
m_szExchangeServer = new TCHAR[nSize];
@@ -562,7 +562,7 @@ HRESULT CMirandaExchange::CreateProfile( LPTSTR szProfileName )
if (FAILED(hr))
return hr;
- nSize = _tcslen(m_szUsername);
+ nSize = mir_tstrlen(m_szUsername);
szUniqName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (nSize + 4));
if (szUniqName != NULL) {
memcpy(szUniqName, _T("="), sizeof(TCHAR));
@@ -867,7 +867,7 @@ HRESULT CMirandaExchange::OpenTheMessage( LPTSTR )
if ( NULL != szTheEnd )
{
- szRegValue[ _tcslen(szRegValue) - _tcslen(szTheEnd) +5 ] = _T('\0');
+ szRegValue[ mir_tstrlen(szRegValue) - mir_tstrlen(szTheEnd) +5 ] = _T('\0');
_tcscat( szRegValue, _T(" /recycle") );
STARTUPINFO si;
PROCESS_INFORMATION pi;
diff --git a/plugins/Exchange/src/emails.cpp b/plugins/Exchange/src/emails.cpp
index 23be8a9359..ae6b2309e7 100644
--- a/plugins/Exchange/src/emails.cpp
+++ b/plugins/Exchange/src/emails.cpp
@@ -69,7 +69,7 @@ int CExchangeServer::Connect(int bForceConnect)
GetStringFromDatabase("Server", _T(""), server, _countof(server));
int port = db_get_dw(NULL, ModuleName, "Port", EXCHANGE_PORT);
- if (_tcslen(server) > 0) //only connect if there's a server to connect to
+ if (mir_tstrlen(server) > 0) //only connect if there's a server to connect to
return DoConnect(user, password, server, port);
_popupUtil(TranslateT("Server is not configured..."));
diff --git a/plugins/Exchange/src/utils.cpp b/plugins/Exchange/src/utils.cpp
index c580d67925..0cda52c2df 100644
--- a/plugins/Exchange/src/utils.cpp
+++ b/plugins/Exchange/src/utils.cpp
@@ -116,7 +116,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult,
dbv.type = DBVT_ASCIIZ;
if (db_get_ts(NULL, ModuleName, szSettingName, &dbv) == 0) {
res = 0;
- int tmp = _tcslen(dbv.ptszVal);
+ int tmp = mir_tstrlen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
_tcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
@@ -124,7 +124,7 @@ int GetStringFromDatabase(char *szSettingName, TCHAR *szError, TCHAR *szResult,
}
else {
res = 1;
- int tmp = _tcslen(szError);
+ int tmp = mir_tstrlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
_tcsncpy(szResult, szError, len);
szResult[len] = '\0';
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp
index e7a78e75a3..eac1b16c21 100644
--- a/plugins/FTPFileYM/src/job_generic.cpp
+++ b/plugins/FTPFileYM/src/job_generic.cpp
@@ -79,7 +79,7 @@ void GenericJob::getFilesFromOpenDialog()
{
TCHAR stzFile[MAX_PATH];
- size_t length = _tcslen(this->stzFilePath);
+ size_t length = mir_tstrlen(this->stzFilePath);
if (this->stzFilePath[0] && this->stzFilePath[length+1]) // multiple files
{
TCHAR *ptr = this->stzFilePath + length + 1;
@@ -87,7 +87,7 @@ void GenericJob::getFilesFromOpenDialog()
{
mir_sntprintf(stzFile, SIZEOF(stzFile), _T("%s\\%s"), this->stzFilePath, ptr);
this->addFile(stzFile);
- ptr += _tcslen(ptr) + 1;
+ ptr += mir_tstrlen(ptr) + 1;
}
}
else
diff --git a/plugins/FTPFileYM/src/utils.cpp b/plugins/FTPFileYM/src/utils.cpp
index ca8f7d3b04..ddecc51625 100644
--- a/plugins/FTPFileYM/src/utils.cpp
+++ b/plugins/FTPFileYM/src/utils.cpp
@@ -61,7 +61,7 @@ TCHAR *Utils::getFileNameFromPath(TCHAR *stzPath)
TCHAR *Utils::getTextFragment(TCHAR *stzText, size_t length, TCHAR *buff)
{
- if (_tcslen(stzText) > length)
+ if (mir_tstrlen(stzText) > length)
{
_tcscpy(buff, stzText);
buff[length - 1] = 0;
@@ -171,7 +171,7 @@ INT_PTR CALLBACK Utils::DlgProcSetFileName(HWND hwndDlg, UINT msg, WPARAM wParam
if (GetDlgCtrlID((HWND)wParam) != IDC_NAME)
{
SetFocus(GetDlgItem(hwndDlg, IDC_NAME));
- SendDlgItemMessage(hwndDlg, IDC_NAME, EM_SETSEL, 0, _tcslen(fileName) - 4);
+ SendDlgItemMessage(hwndDlg, IDC_NAME, EM_SETSEL, 0, mir_tstrlen(fileName) - 4);
return FALSE;
}
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index 154cca7085..6505b3313a 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -57,7 +57,7 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable)
if (!mask->szMask || !bEnable)
return;
- size_t iMaskLen = _tcslen(mask->szMask) + 1;
+ size_t iMaskLen = mir_tstrlen(mask->szMask) + 1;
LPTSTR pszNewMask = (LPTSTR)HeapAlloc(hHeap, HEAP_NO_SERIALIZE, iMaskLen * sizeof(TCHAR));
_tcscpy_s(pszNewMask, iMaskLen, mask->szMask);
_tcsupr_s(pszNewMask, iMaskLen);
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp
index f63bc1cf54..e5ea984121 100644
--- a/plugins/FloatingContacts/src/thumbs.cpp
+++ b/plugins/FloatingContacts/src/thumbs.cpp
@@ -273,7 +273,7 @@ void ThumbInfo::ResizeThumb()
// Get text and icon sizes
SIZEL sizeText;
- GetTextExtentPoint32( hdc, ptszName, (int)_tcslen(ptszName), &sizeText);
+ GetTextExtentPoint32( hdc, ptszName, (int)mir_tstrlen(ptszName), &sizeText);
SelectObject(hdc, hOldFont);
@@ -635,7 +635,7 @@ void ThumbInfo::UpdateContent()
hOldFont = (HFONT)SelectObject(hdcDraw, hFont[index]);
SIZE szText;
- GetTextExtentPoint32(hdcDraw, ptszName, (int)_tcslen(ptszName), &szText);
+ GetTextExtentPoint32(hdcDraw, ptszName, (int)mir_tstrlen(ptszName), &szText);
SetTextColor(hdcDraw, bkColor);
// simple border
diff --git a/plugins/Folders/src/services.cpp b/plugins/Folders/src/services.cpp
index af435d7fdd..4447fdece5 100644
--- a/plugins/Folders/src/services.cpp
+++ b/plugins/Folders/src/services.cpp
@@ -52,7 +52,7 @@ INT_PTR ExpandPath(TCHAR *szResult, TCHAR *format, int size)
mir_free(input);
- return _tcslen(szResult);
+ return mir_tstrlen(szResult);
}
INT_PTR RegisterPathService(WPARAM, LPARAM lParam)
@@ -82,7 +82,7 @@ INT_PTR GetPathSizeService(WPARAM wParam, LPARAM lParam)
if (lstRegisteredFolders.getIndex(p) != -1) {
TCHAR tmp[MAX_FOLDER_SIZE];
p->Expand(tmp, SIZEOF(tmp));
- len = _tcslen(tmp);
+ len = mir_tstrlen(tmp);
}
else len = 0;
diff --git a/plugins/Folders/src/utils.cpp b/plugins/Folders/src/utils.cpp
index 6ec62a1599..4b3a310871 100644
--- a/plugins/Folders/src/utils.cpp
+++ b/plugins/Folders/src/utils.cpp
@@ -184,7 +184,7 @@ int GetStringFromDatabase(char *szSettingName, const wchar_t *szError, TCHAR *sz
size_t len;
DBVARIANT dbv;
if (db_get_ws(NULL, ModuleName, szSettingName, &dbv) == 0) {
- size_t tmp = _tcslen(dbv.ptszVal);
+ size_t tmp = mir_tstrlen(dbv.ptszVal);
len = (tmp < size - 1) ? tmp : size - 1;
_tcsncpy(szResult, dbv.ptszVal, len);
szResult[len] = '\0';
@@ -192,7 +192,7 @@ int GetStringFromDatabase(char *szSettingName, const wchar_t *szError, TCHAR *sz
return 0;
}
- size_t tmp = _tcslen(szError);
+ size_t tmp = mir_tstrlen(szError);
len = (tmp < size - 1) ? tmp : size - 1;
_tcsncpy(szResult, szError, len);
szResult[len] = '\0';
diff --git a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
index a163166dd6..07da9e4f59 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_dlg.cpp
@@ -177,7 +177,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
EmptyClipboard();
- dataLen = (_tcslen(link) + 1) * sizeof(TCHAR);
+ dataLen = (mir_tstrlen(link) + 1) * sizeof(TCHAR);
hData = GlobalAlloc(GMEM_MOVEABLE, dataLen);
_tcscpy_s((LPTSTR)GlobalLock(hData), dataLen / 2, link);
GlobalUnlock(hData);
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
index 38e4ec32b9..e745d627fc 100644
--- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
+++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp
@@ -116,7 +116,7 @@ int ExtractURI(DBEVENTINFO *dbei, MEVENT hEvent, LISTELEMENT *listStart)
CharLower(wordsearch);
for (j = 0; j < SIZEOF(hyperlinkPrefixes); j ++) {
- if (!_tcsncmp(wordsearch, hyperlinkPrefixes[j], _tcslen(hyperlinkPrefixes[j]))) {
+ if (!_tcsncmp(wordsearch, hyperlinkPrefixes[j], mir_tstrlen(hyperlinkPrefixes[j]))) {
isLink = 1;
break;
}
@@ -803,7 +803,7 @@ void GetListInfo(BYTE params, LISTELEMENT *listStart, LPCTSTR searchString, siz
{
(*elementCount)++;
- tempLen = _tcslen(actualElement->link);
+ tempLen = mir_tstrlen(actualElement->link);
if (*maxLen < tempLen)
*maxLen = tempLen;
}
diff --git a/plugins/IEView/src/TemplateHTMLBuilder.cpp b/plugins/IEView/src/TemplateHTMLBuilder.cpp
index d2267fdbba..34b013d07b 100644
--- a/plugins/IEView/src/TemplateHTMLBuilder.cpp
+++ b/plugins/IEView/src/TemplateHTMLBuilder.cpp
@@ -61,7 +61,7 @@ char* TemplateHTMLBuilder::getAvatar(MCONTACT hContact, const char *szProto)
}
}
if (!db_get_ts(hContact, "ContactPhoto", "File", &dbv)) {
- if (_tcslen(dbv.ptszVal) > 0) {
+ if (mir_tstrlen(dbv.ptszVal) > 0) {
TCHAR *ext = _tcsrchr(dbv.ptszVal, '.');
if (ext && mir_tstrcmpi(ext, _T(".xml")) == 0)
result = (TCHAR*)getFlashAvatar(dbv.ptszVal, (hContact == NULL) ? 1 : 0);
diff --git a/plugins/Import/src/utils.cpp b/plugins/Import/src/utils.cpp
index f224873f78..a7ac2cef78 100644
--- a/plugins/Import/src/utils.cpp
+++ b/plugins/Import/src/utils.cpp
@@ -34,7 +34,7 @@ int CreateGroup(const TCHAR *group, MCONTACT hContact)
if (group == NULL)
return 0;
- size_t cbName = _tcslen(group);
+ size_t cbName = mir_tstrlen(group);
TCHAR *tszGrpName = (TCHAR*)_alloca((cbName + 2)*sizeof(TCHAR));
tszGrpName[0] = 1 | GROUPF_EXPANDED;
_tcscpy(tszGrpName + 1, group);
diff --git a/plugins/KeyboardNotify/src/main.cpp b/plugins/KeyboardNotify/src/main.cpp
index 8a9b7c36b8..eb6b3f68ff 100644
--- a/plugins/KeyboardNotify/src/main.cpp
+++ b/plugins/KeyboardNotify/src/main.cpp
@@ -692,7 +692,7 @@ void createEventPrefix(TCHAR *prefixName, size_t maxLen)
while (str = _tcschr(profileName, _T('\\')))
*str = _T('/');
- if ((len = _tcslen(profileName)) <= maxLen)
+ if ((len = mir_tstrlen(profileName)) <= maxLen)
_tcsncpy_s(prefixName, maxLen, profileName, _TRUNCATE);
else {
str = profileName + len - maxLen / 2;
diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp
index 72bf91d5f6..8fbb05e2a9 100644
--- a/plugins/KeyboardNotify/src/options.cpp
+++ b/plugins/KeyboardNotify/src/options.cpp
@@ -873,13 +873,13 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ofn.hInstance = NULL;
_tcscpy(filter, TranslateT("Keyboard Notify Theme"));
wcscat(filter, _T(" (*.knt)"));
- pfilter = filter + _tcslen(filter) + 1;
+ pfilter = filter + mir_tstrlen(filter) + 1;
_tcscpy(pfilter, _T("*.knt"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, TranslateT("All Files"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, _T("*.*"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = _T('\0');
ofn.lpstrFilter = filter;
ofn.lpstrFile = path;
@@ -901,13 +901,13 @@ INT_PTR CALLBACK DlgProcThemeOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ofn.hInstance = NULL;
_tcscpy(filter, TranslateT("Keyboard Notify Theme"));
wcscat(filter, _T(" (*.knt)"));
- pfilter = filter + _tcslen(filter) + 1;
+ pfilter = filter + mir_tstrlen(filter) + 1;
_tcscpy(pfilter, _T("*.knt"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, TranslateT("All Files"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, _T("*.*"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = _T('\0');
ofn.lpstrFilter = filter;
ofn.lpstrFile = path;
@@ -1038,7 +1038,7 @@ void importThemes(const TCHAR *filename, BOOL overrideExisting)
for (str=buffer; *str && isspace(*str); str++); //ltrim
if (!*str || *str == ';') //empty line or comment
continue;
- for (i=_tcslen(str)-1; isspace(str[i]); str[i--]='\0'); //rtrim
+ for (i=mir_tstrlen(str)-1; isspace(str[i]); str[i--]='\0'); //rtrim
switch (status) {
case 0:
if (i > 1 && str[0] == '[' && str[i] == ']') {
@@ -1166,7 +1166,7 @@ INT_PTR CALLBACK DlgProcProcesses(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR szFileNameAux[MAX_PATH+1];
SendDlgItemMessage(hwndDlg, IDC_PROGRAMS, CB_GETLBTEXT, (WPARAM)i, (LPARAM)szFileNameAux);
- ProcessListAux.szFileName[i] = (TCHAR *)malloc((_tcslen(szFileNameAux) + 1)*sizeof(TCHAR));
+ ProcessListAux.szFileName[i] = (TCHAR *)malloc((mir_tstrlen(szFileNameAux) + 1)*sizeof(TCHAR));
if (ProcessListAux.szFileName[i])
_tcscpy(ProcessListAux.szFileName[i], szFileNameAux);
}
@@ -1193,7 +1193,7 @@ void createProcessListAux(void)
if (!ProcessList.szFileName[i])
ProcessListAux.szFileName[i] = NULL;
else {
- ProcessListAux.szFileName[i] = (TCHAR *)malloc((_tcslen(ProcessList.szFileName[i]) + 1)*sizeof(TCHAR));
+ ProcessListAux.szFileName[i] = (TCHAR *)malloc((mir_tstrlen(ProcessList.szFileName[i]) + 1)*sizeof(TCHAR));
if (ProcessListAux.szFileName[i])
_tcscpy(ProcessListAux.szFileName[i], ProcessList.szFileName[i]);
}
diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp
index 90470b4a8b..9a46adf9c5 100644
--- a/plugins/LotusNotify/src/LotusNotify.cpp
+++ b/plugins/LotusNotify/src/LotusNotify.cpp
@@ -1480,15 +1480,15 @@ void checkEnvPath(TCHAR *path)
cur = _tgetenv(_T("PATH"));
_tcslwr(cur);
found = _tcsstr(cur,path);
- len = (int)_tcslen(path);
+ len = (int)mir_tstrlen(path);
if(found != NULL && (found[len] == ';' || found[len] == 0 || (found[len] == '\\' && (found[len+1] == ';' || found[len+1] == 0)))) {
return;
}
- assert(_tcslen(path) + _tcslen(cur) + 1 < SIZEOF(nowy));
+ assert(mir_tstrlen(path) + mir_tstrlen(cur) + 1 < SIZEOF(nowy));
_tcsncpy_s(nowy, _T("PATH="), _TRUNCATE);
_tcscat_s(nowy, cur);
- if(cur[_tcslen(cur)-1]!=';')
+ if(cur[mir_tstrlen(cur)-1]!=';')
_tcscat_s(nowy, _T(";"));
_tcscat_s(nowy, path);
_tcscat_s(nowy, _T(";"));
@@ -1521,7 +1521,7 @@ static int modulesloaded(WPARAM, LPARAM)
GetLotusPath(path, sizeof(path));
checkEnvPath(path);
_tcscat_s(path, _countof(path), _T("nnotes.dll"));
- assert(_tcslen(path)>0);
+ assert(mir_tstrlen(path)>0);
log_p(L"Loading dll: %s", path);
diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp
index e8f0bcbe22..8c185d99af 100644
--- a/plugins/MirOTR/src/otr.cpp
+++ b/plugins/MirOTR/src/otr.cpp
@@ -180,7 +180,7 @@ extern "C" {
mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact));
}
if (context->protocol_version < MIROTR_PROTO_LATEST){
- size_t remaining = _tcslen(buff);
+ size_t remaining = mir_tstrlen(buff);
TCHAR *offset = buff + remaining;
remaining = SIZEOF(buff) - remaining;
mir_sntprintf(offset, remaining, TranslateT("\nusing older protocol version %i"), context->protocol_version);
diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp
index 997abd82e6..9755c3fc18 100644
--- a/plugins/MirOTR/src/utils.cpp
+++ b/plugins/MirOTR/src/utils.cpp
@@ -164,7 +164,7 @@ void ShowPopup(const TCHAR* line1, const TCHAR* line2, int timeout, const MCONTA
mir_sntprintf(title, SIZEOF(title), _T("%s Message"), _T(MODULENAME));
if(line1 && line2) {
- int size = int(_tcslen(line1) + _tcslen(line2) + 3);
+ int size = int(mir_tstrlen(line1) + mir_tstrlen(line2) + 3);
TCHAR *message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), line1, line2);
MessageBox( NULL, message, title, MB_OK | MB_ICONINFORMATION );
@@ -217,7 +217,7 @@ void ShowWarning(TCHAR *msg) {
switch(disp) {
case ED_POP:
{
- int size = int(_tcslen(msg) + 515);
+ int size = int(mir_tstrlen(msg) + 515);
message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), buffer, msg);
PUShowMessageT(message, SM_WARNING);
@@ -264,7 +264,7 @@ void ShowError(TCHAR *msg) {
switch(disp) {
case ED_POP:
{
- int size = int(_tcslen(msg) + 515);
+ int size = int(mir_tstrlen(msg) + 515);
message = new TCHAR[size]; // newline and null terminator
mir_sntprintf(message, size, _T("%s\r\n%s"), buffer, msg);
PUShowMessageT(message, SM_WARNING);
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 3c493878dd..7625b0cc9a 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -80,7 +80,7 @@ static LRESULT CALLBACK MsgEditSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,
int nLen = GetWindowTextLength(hWnd);
TCHAR *text = (TCHAR*)_alloca((nLen + 1) * sizeof(TCHAR));
GetWindowText(hWnd, text, nLen + 1);
- memmove(text + start, text + end, sizeof(TCHAR)* (_tcslen(text) + 1 - end));
+ memmove(text + start, text + end, sizeof(TCHAR)* (mir_tstrlen(text) + 1 - end));
SetWindowText(hWnd, text);
SendMessage(hWnd, EM_SETSEL, start, start);
diff --git a/plugins/NewEventNotify/src/popup.cpp b/plugins/NewEventNotify/src/popup.cpp
index ad88f82562..c2b22c702b 100644
--- a/plugins/NewEventNotify/src/popup.cpp
+++ b/plugins/NewEventNotify/src/popup.cpp
@@ -182,7 +182,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (_tcslen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
// wchar in blob (the old hack)
comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
}
@@ -342,7 +342,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (_tcslen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
// wchar in blob (the old hack)
comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
}
@@ -359,7 +359,7 @@ static TCHAR* GetEventPreview(DBEVENTINFO *dbei)
// utf-8 in blob
comment1 = mir_utf8decodeT((char*)dbei->pBlob);
}
- else if (dbei->cbBlob == (_tcslen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
+ else if (dbei->cbBlob == (mir_tstrlen((TCHAR *)dbei->pBlob)+1)*(sizeof(TCHAR)+1)) {
// wchar in blob (the old hack)
comment1 = mir_tstrdup((TCHAR*)dbei->pBlob);
}
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp
index f333ab12d0..c06d1bd639 100644
--- a/plugins/NewXstatusNotify/src/main.cpp
+++ b/plugins/NewXstatusNotify/src/main.cpp
@@ -687,7 +687,7 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact)
if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
// cut message if needed
TCHAR *copyText = NULL;
- if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (_tcslen(smi.newstatusmsg) > opt.PSMsgLen)) {
+ if (opt.PSMsgTruncate && (opt.PSMsgLen > 0) && smi.newstatusmsg && (mir_tstrlen(smi.newstatusmsg) > opt.PSMsgLen)) {
TCHAR buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(smi.newstatusmsg);
_tcsncpy(buff, smi.newstatusmsg, opt.PSMsgLen);
diff --git a/plugins/NewXstatusNotify/src/xstatus.cpp b/plugins/NewXstatusNotify/src/xstatus.cpp
index fc5ce104c3..42ec34c325 100644
--- a/plugins/NewXstatusNotify/src/xstatus.cpp
+++ b/plugins/NewXstatusNotify/src/xstatus.cpp
@@ -189,7 +189,7 @@ void ShowXStatusPopup(XSTATUSCHANGE *xsc)
// cut message if needed
TCHAR *copyText = NULL;
- if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (_tcslen(xsc->stzText) > opt.PXMsgLen)) {
+ if (opt.PXMsgTruncate && (opt.PXMsgLen > 0) && xsc->stzText && (mir_tstrlen(xsc->stzText) > opt.PXMsgLen)) {
TCHAR buff[MAX_TEXT_LEN + 3];
copyText = mir_tstrdup(xsc->stzText);
_tcsncpy(buff, xsc->stzText, opt.PXMsgLen);
diff --git a/plugins/New_GPG/src/gpg_wrapper.cpp b/plugins/New_GPG/src/gpg_wrapper.cpp
index 57f8d79205..2c9c57fc92 100755
--- a/plugins/New_GPG/src/gpg_wrapper.cpp
+++ b/plugins/New_GPG/src/gpg_wrapper.cpp
@@ -48,7 +48,7 @@ pxResult pxExecute(std::vector<std::wstring> &aargv, string *aoutput, LPDWORD ae
env.push_back(L"LC_ALL=English");
argv.push_back(bin_path);
TCHAR *home_dir = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
- if(_tcslen(home_dir)) //this check are required for first run gpg binary validation
+ if(mir_tstrlen(home_dir)) //this check are required for first run gpg binary validation
{
argv.push_back(L"--homedir");
argv.push_back(home_dir);
diff --git a/plugins/New_GPG/src/main.cpp b/plugins/New_GPG/src/main.cpp
index ed3737b847..7ca182d3d6 100755
--- a/plugins/New_GPG/src/main.cpp
+++ b/plugins/New_GPG/src/main.cpp
@@ -861,7 +861,7 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
SetCurrentDirectoryA(mir_path);
tmp = mir_a2t(mir_path);
mir_free(mir_path);
- mir_realloc(path, (_tcslen(path)+128)*sizeof(TCHAR));
+ mir_realloc(path, (mir_tstrlen(path)+128)*sizeof(TCHAR));
TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH), *gpg_lang_path = (TCHAR*)mir_alloc(sizeof(TCHAR) * MAX_PATH);
_tcscpy(gpg_path, tmp);
_tcscat(gpg_path, _T("\\GnuPG\\gpg.exe"));
@@ -1052,8 +1052,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp));
- while(tmp[_tcslen(tmp)-1] == '\\')
- tmp[_tcslen(tmp)-1] = '\0';
+ while(tmp[mir_tstrlen(tmp)-1] == '\\')
+ tmp[mir_tstrlen(tmp)-1] = '\0';
if(!tmp[0])
{
MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK);
@@ -1130,8 +1130,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
}
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp));
- while(tmp[_tcslen(tmp)-1] == '\\')
- tmp[_tcslen(tmp)-1] = '\0';
+ while(tmp[mir_tstrlen(tmp)-1] == '\\')
+ tmp[mir_tstrlen(tmp)-1] = '\0';
if(!tmp[0])
{
MessageBox(0, TranslateT("Please set keyring's home directory"), TranslateT("Warning"), MB_OK);
@@ -1371,7 +1371,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
{ //data sanity checks
TCHAR *tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*5);
GetDlgItemText(hwndDlg, IDC_KEY_TYPE, tmp, 5);
- if(_tcslen(tmp) < 3)
+ if(mir_tstrlen(tmp) < 3)
{
mir_free(tmp); tmp = NULL;
MessageBox(0, TranslateT("You must set encryption algorithm first"), TranslateT("Error"), MB_OK);
@@ -1390,7 +1390,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
}
tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*12);
GetDlgItemText(hwndDlg, IDC_KEY_EXPIRE_DATE, tmp, 11);
- if(_tcslen(tmp) != 10 && tmp[0] != '0')
+ if(mir_tstrlen(tmp) != 10 && tmp[0] != '0')
{
MessageBox(0, TranslateT("Invalid date"), TranslateT("Error"), MB_OK);
mir_free(tmp);
@@ -1399,7 +1399,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp);
tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*128);
GetDlgItemText(hwndDlg, IDC_KEY_REAL_NAME, tmp, 127);
- if(_tcslen(tmp) < 5)
+ if(mir_tstrlen(tmp) < 5)
{
MessageBox(0, TranslateT("Name must contain at least 5 characters"), TranslateT("Error"), MB_OK);
mir_free(tmp);
@@ -1414,7 +1414,7 @@ static INT_PTR CALLBACK DlgProcKeyGenDialog(HWND hwndDlg, UINT msg, WPARAM wPara
mir_free(tmp);
tmp = (TCHAR*)mir_alloc(sizeof(TCHAR)*128);
GetDlgItemText(hwndDlg, IDC_KEY_EMAIL, tmp, 128);
- if((_tcslen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.'))))
+ if((mir_tstrlen(tmp)) < 5 || (!_tcschr(tmp, _T('@'))) || (!_tcschr(tmp, _T('.'))))
{
MessageBox(0, TranslateT("Invalid Email"), TranslateT("Error"), MB_OK);
mir_free(tmp);
diff --git a/plugins/New_GPG/src/messages.cpp b/plugins/New_GPG/src/messages.cpp
index b29af2b1d4..ea2b7370f3 100755
--- a/plugins/New_GPG/src/messages.cpp
+++ b/plugins/New_GPG/src/messages.cpp
@@ -72,7 +72,7 @@ void RecvMsgSvc_func(MCONTACT hContact, std::wstring str, char *msg, DWORD flags
debuglog<<std::string(time_str()+": info: received encrypted message from: "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR)));
}
boost::algorithm::erase_all(str, "\r");
- s2 += _tcslen(_T("-----END PGP MESSAGE-----"));
+ s2 += mir_tstrlen(_T("-----END PGP MESSAGE-----"));
char *tmp = mir_t2a(str.substr(s1,s2-s1).c_str());
TCHAR *tmp2 = UniGetContactSettingUtf(NULL, szGPGModuleName, "szHomePath", _T(""));
wstring path = tmp2;
@@ -372,7 +372,7 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
{
if(bDebugLog)
debuglog<<std::string(time_str()+": info(autoexchange): found pubkey block:"+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ccs->hContact, GCDNF_TCHAR)));
- s2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
+ s2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
db_set_ts(ccs->hContact, szGPGModuleName, "GPGPubKey", str.substr(s1,s2-s1).c_str());
{ //gpg execute block
std::vector<wstring> cmd;
@@ -499,11 +499,11 @@ INT_PTR RecvMsgSvc(WPARAM w, LPARAM l)
void ShowNewKeyDialog();
if(((s2 = str.find(_T("-----END PGP PUBLIC KEY BLOCK-----"))) != wstring::npos) && ((s1 = str.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----"))) != wstring::npos))
{
- s2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
+ s2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
}
else if(((s2 = str.find(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----"))) != wstring::npos) && ((s1 = str.find(_T("-----END PGP PRIVATE KEY BLOCK-----"))) != wstring::npos))
{
- s2 += _tcslen(_T("-----END PGP PRIVATE KEY BLOCK-----"));
+ s2 += mir_tstrlen(_T("-----END PGP PRIVATE KEY BLOCK-----"));
}
new_key.append(str.substr(s1,s2-s1));
//new_key_hcnt_mutex.lock();
@@ -976,7 +976,7 @@ static INT_PTR CALLBACK DlgProcKeyPassword(HWND hwndDlg, UINT msg, WPARAM wParam
}
if(password)
mir_free(password);
- password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1));
+ password = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1));
_tcscpy(password, tmp);
}
mir_free(tmp);
diff --git a/plugins/New_GPG/src/options.cpp b/plugins/New_GPG/src/options.cpp
index 80b49f59c7..045623b8b0 100755
--- a/plugins/New_GPG/src/options.cpp
+++ b/plugins/New_GPG/src/options.cpp
@@ -135,7 +135,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyID", "");
tmp = mir_a2t(tmp2);
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 1, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 1, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
char *tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", "");
if(!toUTF16(tmp2).empty())
@@ -143,7 +143,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainName", _T(""));
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 2, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 2, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
tmp2 = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", "");
if(!toUTF16(tmp2).empty())
@@ -151,7 +151,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
tmp = UniGetContactSettingUtf(hContact, szGPGModuleName, "KeyMainEmail", _T(""));
mir_free(tmp2);
- ListView_SetItemText(hwndList, iRow, 3, (_tcslen(tmp) > 1)?tmp:_T("not set"));
+ ListView_SetItemText(hwndList, iRow, 3, (mir_tstrlen(tmp) > 1)?tmp:_T("not set"));
mir_free(tmp);
if(db_get_b(hContact, szGPGModuleName, "GPGEncryption", 0))
ListView_SetCheckState(hwndList, iRow, 1);
@@ -166,7 +166,7 @@ static INT_PTR CALLBACK DlgProcGpgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
}
tmp = UniGetContactSettingUtf(NULL, szGPGModuleName, "szLogFilePath", _T(""));
- SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (_tcslen(tmp) > 1)?tmp:_T("c:\\GPGdebug.log"));
+ SetDlgItemText(hwndDlg, IDC_LOG_FILE_EDIT, (mir_tstrlen(tmp) > 1)?tmp:_T("c:\\GPGdebug.log"));
mir_free(tmp);
CheckStateLoadDB(hwndDlg, IDC_DEBUG_LOG, "bDebugLog", 0);
EnableWindow(GetDlgItem(hwndDlg, IDC_JABBER_API), bIsMiranda09);
@@ -571,8 +571,8 @@ static INT_PTR CALLBACK DlgProcGpgBinOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_BIN_PATH, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szGpgBinPath", tmp);
GetDlgItemText(hwndDlg, IDC_HOME_DIR, tmp, SIZEOF(tmp));
- while(tmp[_tcslen(tmp)-1] == '\\')
- tmp[_tcslen(tmp)-1] = '\0';
+ while(tmp[mir_tstrlen(tmp)-1] == '\\')
+ tmp[mir_tstrlen(tmp)-1] = '\0';
db_set_ts(NULL, szGPGModuleName, "szHomePath", tmp);
return TRUE;
}
@@ -638,22 +638,22 @@ static INT_PTR CALLBACK DlgProcGpgMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_IN_OPEN_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szInOpenTag", tmp);
mir_free(inopentag);
- inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ inopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(inopentag, tmp);
GetDlgItemText(hwndDlg, IDC_IN_CLOSE_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szInCloseTag", tmp);
mir_free(inclosetag);
- inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ inclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(inclosetag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_OPEN_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutOpenTag", tmp);
mir_free(outopentag);
- outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (_tcslen(tmp)+1));
+ outopentag = (TCHAR*)mir_alloc(sizeof(TCHAR)* (mir_tstrlen(tmp)+1));
_tcscpy(outopentag, tmp);
GetDlgItemText(hwndDlg, IDC_OUT_CLOSE_TAG, tmp, SIZEOF(tmp));
db_set_ts(NULL, szGPGModuleName, "szOutCloseTag", tmp);
mir_free(outclosetag);
- outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(tmp)+1));
+ outclosetag = (TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(tmp)+1));
_tcscpy(outclosetag, tmp);
}
return TRUE;
@@ -855,16 +855,16 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
ws1 = 0;
if(((ws2 = key_buf.find(_T("-----END PGP PUBLIC KEY BLOCK-----"))) != wstring::npos) && ((ws1 = key_buf.find(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----"))) != wstring::npos))
{
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")) + 1));
+ begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----BEGIN PGP PUBLIC KEY BLOCK-----")) + 1));
_tcscpy(begin, _T("-----BEGIN PGP PUBLIC KEY BLOCK-----"));
- end = (TCHAR*)mir_alloc(sizeof( TCHAR) * (_tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----")) + 1));
+ end = (TCHAR*)mir_alloc(sizeof( TCHAR) * (mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----")) + 1));
_tcscpy(end, _T("-----END PGP PUBLIC KEY BLOCK-----"));
}
else if(((ws2 = key_buf.find(_T("-----END PGP PRIVATE KEY BLOCK-----"))) != wstring::npos) && ((ws1 = key_buf.find(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----"))) != wstring::npos))
{
- begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")) + 1));
+ begin = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----BEGIN PGP PRIVATE KEY BLOCK-----")) + 1));
_tcscpy(begin, _T("-----BEGIN PGP PRIVATE KEY BLOCK-----"));
- end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (_tcslen(_T("-----END PGP PRIVATE KEY BLOCK-----")) + 1));
+ end = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(_T("-----END PGP PRIVATE KEY BLOCK-----")) + 1));
_tcscpy(end, _T("-----END PGP PRIVATE KEY BLOCK-----"));
}
else
@@ -872,7 +872,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
MessageBox(0, TranslateT("This is not public or private key"), _T("INFO"), MB_OK);
break;
}
- ws2 += _tcslen(end);
+ ws2 += mir_tstrlen(end);
bool allsubcontacts = false;
{
if(db_mc_isMeta(hContact))
@@ -1252,7 +1252,7 @@ static INT_PTR CALLBACK DlgProcLoadPublicKey(HWND hwndDlg,UINT msg,WPARAM wParam
MessageBox(0, TranslateT("There is no public or private key."), TranslateT("Info"), MB_OK);
break;
}
- ws2 += _tcslen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
+ ws2 += mir_tstrlen(_T("-----END PGP PUBLIC KEY BLOCK-----"));
SetDlgItemText(hwndDlg, IDC_PUBLIC_KEY_EDIT, key_buf.substr(ws1,ws2-ws1).c_str());
key_buf.clear();
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp
index 63ece6aab0..76b338c6a3 100755
--- a/plugins/New_GPG/src/utilities.cpp
+++ b/plugins/New_GPG/src/utilities.cpp
@@ -62,15 +62,15 @@ void GetFilePath(TCHAR *WindowTittle, char *szSetting, TCHAR *szExt, TCHAR *szEx
ofn.Flags=OFN_EXPLORER;
ofn.lpstrTitle=TranslateW(WindowTittle);
_tcsncpy(filter,TranslateW(szExtDesc), SIZEOF(filter)-1);
- pfilter=filter+_tcslen(filter)+1;
+ pfilter=filter+mir_tstrlen(filter)+1;
_tcscpy(pfilter, szExt);
- pfilter[_tcslen(pfilter)+1] = '\0';
- pfilter[_tcslen(pfilter)+2] = '\0';
+ pfilter[mir_tstrlen(pfilter)+1] = '\0';
+ pfilter[mir_tstrlen(pfilter)+2] = '\0';
ofn.lpstrFilter=filter;
tmp = UniGetContactSettingUtf(0, szGPGModuleName, szSetting, _T(""));
_tcsncpy(str, tmp, SIZEOF(str)-1);
mir_free(tmp);
- if(_tcslen(str)< 2)
+ if(mir_tstrlen(str)< 2)
str[0] = '\0';
ofn.lpstrFile=str;
ofn.nMaxFile=_MAX_PATH;
@@ -89,13 +89,13 @@ TCHAR *GetFilePath(TCHAR *WindowTittle, TCHAR *szExt, TCHAR *szExtDesc, bool sav
ofn.Flags=OFN_EXPLORER;
ofn.lpstrTitle=TranslateW(WindowTittle);
_tcscpy(filter,TranslateW(szExtDesc));
- pfilter=filter+_tcslen(filter)+1;
+ pfilter=filter+mir_tstrlen(filter)+1;
_tcscpy(pfilter, szExt);
- pfilter[_tcslen(pfilter)+1] = '\0';
- pfilter[_tcslen(pfilter)+2] = '\0';
+ pfilter[mir_tstrlen(pfilter)+1] = '\0';
+ pfilter[mir_tstrlen(pfilter)+2] = '\0';
ofn.lpstrFilter=filter;
_tcscpy(str, _T(""));
- if(_tcslen(str)< 2)
+ if(mir_tstrlen(str)< 2)
str[0] = '\0';
ofn.lpstrFile=str;
ofn.nMaxFile=_MAX_PATH;
@@ -336,7 +336,7 @@ int onProtoAck(WPARAM w, LPARAM l)
cmd.push_back(L"-o");
wstring file = filename;
wstring::size_type p1 = file.rfind(_T(".gpg"));
- file.erase(p1, _tcslen(_T(".gpg")));
+ file.erase(p1, mir_tstrlen(_T(".gpg")));
if(boost::filesystem::exists(file))
{
if(MessageBox(0, TranslateT("Target file exists, do you want to replace it?"), TranslateT("Warning"), MB_YESNO) == IDNO)
@@ -354,16 +354,16 @@ int onProtoAck(WPARAM w, LPARAM l)
dbsetting += keyid;
dbsetting += "_Password";
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, dbsetting.c_str(), _T(""));
- if(_tcslen(pass) > 0 && bDebugLog)
+ if(mir_tstrlen(pass) > 0 && bDebugLog)
debuglog<<std::string(time_str()+": info: found password in database for key ID: "+keyid+", trying to decrypt message from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR))+" with password");
}
else
{
pass = UniGetContactSettingUtf(NULL, szGPGModuleName, "szKeyPassword", _T(""));
- if(_tcslen(pass) > 0 && bDebugLog)
+ if(mir_tstrlen(pass) > 0 && bDebugLog)
debuglog<<std::string(time_str()+": info: found password for all keys in database, trying to decrypt message from "+toUTF8((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)ack->hContact, GCDNF_TCHAR))+" with password");
}
- if(_tcslen(pass) > 0)
+ if(mir_tstrlen(pass) > 0)
{
cmd.push_back(L"--passphrase");
cmd.push_back(pass);
@@ -483,8 +483,8 @@ std::wstring encrypt_file(MCONTACT hContact, TCHAR *filename)
name = filename;
else
name++;
- TCHAR *file_out = new TCHAR [_tcslen(name) + _tcslen(_T(".gpg")) + 1];
- mir_sntprintf(file_out, _tcslen(name) + _tcslen(_T(".gpg")) + 1, _T("%s.gpg"), name);
+ TCHAR *file_out = new TCHAR [mir_tstrlen(name) + mir_tstrlen(_T(".gpg")) + 1];
+ mir_sntprintf(file_out, mir_tstrlen(name) + mir_tstrlen(_T(".gpg")) + 1, _T("%s.gpg"), name);
cmd.push_back(szKeyid);
if(db_get_b(hcnt, szGPGModuleName, "bAlwaysTrust", 0))
{
@@ -723,7 +723,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
{
wstring data = str;
xi.setText(local_node, _T("This message is encrypted."));
- wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + _tcslen(_T("-----BEGIN PGP MESSAGE-----"));
+ wstring::size_type p1 = data.find(_T("-----BEGIN PGP MESSAGE-----")) + mir_tstrlen(_T("-----BEGIN PGP MESSAGE-----"));
while(data.find(_T("Version: "), p1) != wstring::npos)
{
p1 = data.find(_T("Version: "), p1);
@@ -859,7 +859,7 @@ static JABBER_HANDLER_FUNC SendHandler(IJabberInterface *ji, HXML node, void *pU
}
if(data.find(_T("-----BEGIN PGP SIGNATURE-----")) != wstring::npos && data.find(_T("-----END PGP SIGNATURE-----")) != wstring::npos)
{
- wstring::size_type p1 = data.find(_T("-----BEGIN PGP SIGNATURE-----")) + _tcslen(_T("-----BEGIN PGP SIGNATURE-----"));
+ wstring::size_type p1 = data.find(_T("-----BEGIN PGP SIGNATURE-----")) + mir_tstrlen(_T("-----BEGIN PGP SIGNATURE-----"));
if(data.find(_T("Version: "), p1) != wstring::npos)
{
p1 = data.find(_T("Version: "), p1);
@@ -1091,7 +1091,7 @@ bool isContactSecured(MCONTACT hContact)
bool isContactHaveKey(MCONTACT hContact)
{
TCHAR *key = UniGetContactSettingUtf(hContact, szGPGModuleName, "GPGPubKey", _T(""));
- if(_tcslen(key) > 0)
+ if(mir_tstrlen(key) > 0)
{
mir_free(key);
return true;
@@ -1133,7 +1133,7 @@ bool isGPGValid()
SetCurrentDirectoryW(mir_path);
tmp = mir_tstrdup(mir_path);
mir_free(mir_path);
- //mir_realloc(path, (_tcslen(path)+64)*sizeof(TCHAR));
+ //mir_realloc(path, (mir_tstrlen(path)+64)*sizeof(TCHAR));
TCHAR *gpg_path = (TCHAR*)mir_alloc(sizeof(TCHAR)*MAX_PATH);
_tcscpy(gpg_path, tmp);
_tcscat(gpg_path, _T("\\GnuPG\\gpg.exe"));
diff --git a/plugins/NotesAndReminders/src/notes.cpp b/plugins/NotesAndReminders/src/notes.cpp
index a88a04bb8a..baf56932b8 100644
--- a/plugins/NotesAndReminders/src/notes.cpp
+++ b/plugins/NotesAndReminders/src/notes.cpp
@@ -1043,7 +1043,7 @@ static void MeasureColorPresetMenuItem(HWND hdlg, LPMEASUREITEMSTRUCT lpMeasureI
HDC hdc = GetDC(hdlg);
LPTSTR lpsz = TranslateTS(clrPresets->szName);
SIZE sz;
- GetTextExtentPoint32(hdc, lpsz, (int)_tcslen(lpsz), &sz);
+ GetTextExtentPoint32(hdc, lpsz, (int)mir_tstrlen(lpsz), &sz);
ReleaseDC(hdlg, hdc);
lpMeasureItem->itemWidth = 50 + sz.cx;
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp
index e01f83ad91..a2f366e6d8 100644
--- a/plugins/NotesAndReminders/src/options.cpp
+++ b/plugins/NotesAndReminders/src/options.cpp
@@ -302,7 +302,7 @@ static void TrimString(TCHAR *s)
return;
TCHAR *start = s;
- UINT n = UINT(_tcslen(s) - 1);
+ UINT n = UINT(mir_tstrlen(s) - 1);
TCHAR *end = s + n;
diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp
index 2e2d8ec2b7..ad5517938b 100644
--- a/plugins/QuickMessages/src/Utils.cpp
+++ b/plugins/QuickMessages/src/Utils.cpp
@@ -365,7 +365,7 @@ TCHAR* getMenuEntry(int buttonnum, int entrynum, BYTE mode)
}
if (!db_get_ts(NULL, PLGNAME, szMEntry, &dbv)) {
- if (_tcslen(dbv.ptszVal))
+ if (mir_tstrlen(dbv.ptszVal))
buffer = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -463,7 +463,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt
break;
case 'P':
ptszName = mir_a2u(GetContactProto(hContact));
- NameLenght = (int)_tcslen(ptszName);
+ NameLenght = (int)mir_tstrlen(ptszName);
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p) {
mir_free(ptszName);
@@ -488,7 +488,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt
case 'n':
ptszName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
- NameLenght = (int)_tcslen(ptszName);
+ NameLenght = (int)mir_tstrlen(ptszName);
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p)
break;
@@ -516,7 +516,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt
if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
break;
- NameLenght = (int)_tcslen(ci.pszVal);
+ NameLenght = (int)mir_tstrlen(ci.pszVal);
ptszName = ci.pszVal;
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p) {
@@ -548,7 +548,7 @@ TCHAR* ParseString(MCONTACT hContact,TCHAR* ptszQValIn,TCHAR* ptszText,TCHAR* pt
if (CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci))
break;
- NameLenght = (int)_tcslen(ci.pszVal);
+ NameLenght = (int)mir_tstrlen(ci.pszVal);
ptszName = ci.pszVal;
p = (TCHAR *)realloc(tempQValue, (QVSize + NameLenght + 1) * sizeof(TCHAR));
if (!p) {
diff --git a/plugins/QuickMessages/src/main.cpp b/plugins/QuickMessages/src/main.cpp
index 4c3e63473c..c3ee162400 100644
--- a/plugins/QuickMessages/src/main.cpp
+++ b/plugins/QuickMessages/src/main.cpp
@@ -98,7 +98,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
hData= GetClipboardData(CF_UNICODETEXT);
chBuffer= (TCHAR*)GlobalLock(hData);
- textLength=(int)_tcslen(chBuffer);
+ textLength=(int)mir_tstrlen(chBuffer);
pszCBText=mir_tstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
@@ -115,7 +115,7 @@ static int InputMenuPopup(WPARAM wParam,LPARAM lParam)
SendMessage(mwpd->hwnd,EM_GETSELTEXT, 0, (LPARAM)pszText);
}
if(qd->ptszValue){
- ptszQValue=ParseString(mwpd->hContact,qd->ptszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(qd->ptszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
+ ptszQValue=ParseString(mwpd->hContact,qd->ptszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(qd->ptszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
if ((bIsService=qd->bIsService)&&ptszQValue)
CallService(mir_u2a(ptszQValue),(WPARAM)mwpd->hContact,0);
@@ -173,7 +173,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
hData= GetClipboardData(CF_UNICODETEXT);
chBuffer= (TCHAR*)GlobalLock(hData);
- textLength=(int)_tcslen(chBuffer);
+ textLength=(int)mir_tstrlen(chBuffer);
pszCBText=mir_tstrdup(chBuffer);
GlobalUnlock(hData);
CloseClipboard();
@@ -206,7 +206,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
switch(state) {
case 1:
if(ButtonsList[cbcd->dwButtonId]->ptszQValue)
- ptszQValue = ParseString(cbcd->hContact,ButtonsList[cbcd->dwButtonId]->ptszQValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(ButtonsList[cbcd->dwButtonId]->ptszQValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
+ ptszQValue = ParseString(cbcd->hContact,ButtonsList[cbcd->dwButtonId]->ptszQValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(ButtonsList[cbcd->dwButtonId]->ptszQValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
if ((bIsService = ButtonsList[cbcd->dwButtonId]->bIsServName) && ptszQValue)
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
break;
@@ -215,7 +215,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
{
ButtonData *bd = (ButtonData *)sl->items[0];
if(bd && bd->pszValue){
- ptszQValue = ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
+ ptszQValue = ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(bd->pszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
if ((bIsService = bd->bIsServName)&&ptszQValue)
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
}
@@ -263,7 +263,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
bd= (ButtonData *)sl->items[res-1];
bCTRL=(GetKeyState(VK_CONTROL)&0x8000)?1:0;
if(bd->pszValue){
- ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)_tcslen(bd->pszValue),textlenght,pszCBText?(int)_tcslen(pszCBText):0);
+ ptszQValue=ParseString(cbcd->hContact,bd->pszValue,pszText?pszText:_T(""),pszCBText?pszCBText:_T(""),(int)mir_tstrlen(bd->pszValue),textlenght,pszCBText?(int)mir_tstrlen(pszCBText):0);
if ((bIsService=bd->bIsServName)&&ptszQValue)
CallService(mir_u2a(ptszQValue),(WPARAM)cbcd->hContact,0);
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp
index b1c66f66ad..103d0fe923 100644
--- a/plugins/QuickMessages/src/options.cpp
+++ b/plugins/QuickMessages/src/options.cpp
@@ -124,7 +124,7 @@ void SetMenuEntryProperties(HWND hdlg)
ListData* ld = ( ListData* )tvi.lParam;
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_RCLICKVALUE, szValue, SIZEOF(szValue));
- if(_tcslen(szValue))
+ if(mir_tstrlen(szValue))
{
if(ld->ptszOPQValue&&(ld->ptszOPQValue!=ld->ptszQValue))
mir_free(ld->ptszOPQValue);
@@ -145,9 +145,9 @@ void SetMenuEntryProperties(HWND hdlg)
ButtonData* bd = ( ButtonData* )tvi.lParam;
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, SIZEOF(szValue));
- if(_tcslen(szValue))
+ if(mir_tstrlen(szValue))
{
- if(_tcslen(bd->pszOpValue)&&(bd->pszOpValue!=bd->pszValue))
+ if(mir_tstrlen(bd->pszOpValue)&&(bd->pszOpValue!=bd->pszValue))
mir_free(bd->pszOpValue);
bd->pszOpValue=mir_tstrdup(szValue);
}
@@ -773,7 +773,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetWindowText(hwndEdit, szLabel, SIZEOF(szLabel));
hwndEdit=NULL;
- if (!_tcslen(szLabel)) break;
+ if (!mir_tstrlen(szLabel)) break;
if (bd = (ButtonData*)tvi.lParam){
if (!_tcscmp(szLabel,_T("---"))) {
if(TreeView_GetChild(hMenuTree,tvi.hItem))
@@ -829,7 +829,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
if (bd) {
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, SIZEOF(szValue));
- if(_tcslen(szValue))
+ if(mir_tstrlen(szValue))
{
if(bd->pszOpValue&&(bd->pszOpValue!=bd->pszValue))
mir_free(bd->pszOpValue);
@@ -905,7 +905,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetWindowText(hwndEdit, szLabel, SIZEOF(szLabel));
hwndEdit=NULL;
- if (!_tcslen(szLabel)) break;
+ if (!mir_tstrlen(szLabel)) break;
tvi.pszText=szLabel;
((ListData*)tvi.lParam)->dwOPFlags|=QMF_RENAMED;
@@ -992,7 +992,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetDlgItemText(hdlg, IDC_BUTTONNAME, namebuff, SIZEOF(namebuff));
tvis.item.mask=TVIF_PARAM|TVIF_TEXT;
- tvis.item.pszText=(_tcslen(namebuff))?namebuff:TranslateT("New Button");
+ tvis.item.pszText=(mir_tstrlen(namebuff))?namebuff:TranslateT("New Button");
tvis.item.lParam=(LPARAM)ld;
TreeView_SelectItem(hButtonsList,TreeView_InsertItem(hButtonsList,&tvis));
}break;
@@ -1042,7 +1042,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
GetDlgItemText(hdlg, IDC_MENUNAME, namebuff, SIZEOF(namebuff));
bd->dwOPPos=TreeView_GetCount(hMenuTree)-1;
- bd->pszOpName=_tcslen(namebuff)?mir_tstrdup(namebuff):mir_tstrdup(TranslateT("New Menu Entry"));
+ bd->pszOpName=mir_tstrlen(namebuff)?mir_tstrdup(namebuff):mir_tstrdup(TranslateT("New Menu Entry"));
bd->pszOpValue=mir_tstrdup(bd->pszOpName);
bd->fEntryOpType=!_tcscmp(namebuff,_T("---"))?QMF_EX_SEPARATOR:0;
bd->dwOPFlags=QMF_NEW;
diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp
index 52abaa46df..e94245e3c3 100644
--- a/plugins/Quotes/src/QuoteInfoDlg.cpp
+++ b/plugins/Quotes/src/QuoteInfoDlg.cpp
@@ -77,7 +77,7 @@ namespace
TCHAR szTime[50];
if (0 == _tctime_s(szTime, 50, &nFetchTime))
{
- szTime[::_tcslen(szTime) - 1] = _T('\0');
+ szTime[::mir_tstrlen(szTime) - 1] = _T('\0');
::SetDlgItemText(hdlg, IDC_EDIT_RATE_FETCH_TIME, szTime);
}
}
diff --git a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
index d05b7c082c..f4bbc2fe7f 100644
--- a/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
+++ b/plugins/Quotes/src/QuotesProviderGoogleFinance.cpp
@@ -89,7 +89,7 @@ namespace
tstring get_company_id(const tstring& rsHTML)
{
static LPCTSTR pszVarName = _T("setCompanyId(");
- static size_t cVarNameLength = _tcslen(pszVarName);
+ static size_t cVarNameLength = mir_tstrlen(pszVarName);
tstring sResult;
tstring::size_type n = rsHTML.find(pszVarName);
@@ -116,7 +116,7 @@ namespace
tstring get_company_name(const tstring& rsHTML)
{
static LPCTSTR pszVarName = _T("var _companyName = ");
- static size_t cVarNameLength = _tcslen(pszVarName);
+ static size_t cVarNameLength = mir_tstrlen(pszVarName);
tstring s = get_var_value(rsHTML, pszVarName, cVarNameLength);
if (s.size() > 0 && _T('\'') == s[0])
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index a66f2b3398..6c0323998c 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -221,7 +221,7 @@ static void TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
start -= 2;
if (dat->szSearchResult != NULL) {
- int cbResult = (int)_tcslen(dat->szSearchResult);
+ int cbResult = (int)mir_tstrlen(dat->szSearchResult);
if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
@@ -276,7 +276,7 @@ LBL_SkipEnd:
if (end != start) {
ptrT szReplace;
if (!isRoom && !isTopic && g_Settings.bAddColonToAutoComplete && start == 0) {
- szReplace = (TCHAR*)mir_alloc((_tcslen(pszName) + 4) * sizeof(TCHAR));
+ szReplace = (TCHAR*)mir_alloc((mir_tstrlen(pszName) + 4) * sizeof(TCHAR));
_tcscpy(szReplace, pszName);
_tcscat(szReplace, _T(": "));
pszName = szReplace;
diff --git a/plugins/Scriver/src/msgwindow.cpp b/plugins/Scriver/src/msgwindow.cpp
index 71874509a9..70902bc0b5 100644
--- a/plugins/Scriver/src/msgwindow.cpp
+++ b/plugins/Scriver/src/msgwindow.cpp
@@ -89,7 +89,7 @@ TCHAR* GetWindowTitle(MCONTACT hContact, const char *szProto)
for (len = 0, p = tmplt; *p; p++, len++) {
if (*p == '%') {
for (i = 0; i < SIZEOF(titleTokenNames); i++) {
- int tnlen = (int)_tcslen(titleTokenNames[i]);
+ int tnlen = (int)mir_tstrlen(titleTokenNames[i]);
if (!_tcsncmp(p, titleTokenNames[i], tnlen)) {
len += tokenLen[i] - 1;
p += tnlen - 1;
diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp
index aa1e5bdfb9..5b468ea34b 100644
--- a/plugins/SimpleAR/src/Main.cpp
+++ b/plugins/SimpleAR/src/Main.cpp
@@ -209,12 +209,12 @@ INT addEvent(WPARAM hContact, LPARAM hDBEvent)
return FALSE;
}
- msgLen += (int)_tcslen(dbv.ptszVal);
+ msgLen += (int)mir_tstrlen(dbv.ptszVal);
if (!db_get_ts(NULL,protocolname,KEY_HEADING,&dbvHead))
{
ptszTemp = dbvHead.ptszVal;
ptszTemp.Replace(_T("%user%"), dbvNick.ptszVal);
- msgLen += (int)(_tcslen(ptszTemp));
+ msgLen += (int)(mir_tstrlen(ptszTemp));
}
ptszTemp2 = (TCHAR*)mir_alloc(sizeof(TCHAR) * (msgLen+5));
mir_sntprintf(ptszTemp2, msgLen+5, _T("%s\r\n\r\n%s"), ptszTemp.c_str(), dbv.ptszVal);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp
index c59d2184e4..3aa567406b 100644
--- a/plugins/SimpleStatusMsg/src/main.cpp
+++ b/plugins/SimpleStatusMsg/src/main.cpp
@@ -122,7 +122,7 @@ static TCHAR *GetWinampSong(void)
if (pstr < szTitle + (iTitleLen / 2))
{
- memmove(szTitle, pstr + 9, _tcslen(pstr + 9) * sizeof(TCHAR));
+ memmove(szTitle, pstr + 9, mir_tstrlen(pstr + 9) * sizeof(TCHAR));
pstr = _tcsstr(pstr + 1, _T(" - Winamp"));
if (pstr == NULL)
{
diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp
index 5d2f6a3d40..f2e0474f86 100644
--- a/plugins/SmileyAdd/src/options.cpp
+++ b/plugins/SmileyAdd/src/options.cpp
@@ -535,14 +535,14 @@ bool OptionsDialogType::BrowseForSmileyPacks(int item)
TCHAR filter[512], *pfilter;
_tcscpy(filter, TranslateT("Smiley packs"));
mir_tstrcat(filter, _T(" (*.msl;*.asl;*.xep)"));
- pfilter = filter + _tcslen(filter) + 1;
+ pfilter = filter + mir_tstrlen(filter) + 1;
_tcscpy(pfilter, _T("*.msl;*.asl;*.xep"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, TranslateT("All files"));
mir_tstrcat(pfilter, _T(" (*.*)"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
_tcscpy(pfilter, _T("*.*"));
- pfilter = pfilter + _tcslen(pfilter) + 1;
+ pfilter = pfilter + mir_tstrlen(pfilter) + 1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp
index dee33a833c..47c231ab6f 100644
--- a/plugins/Spamotron/src/options.cpp
+++ b/plugins/Spamotron/src/options.cpp
@@ -7,9 +7,9 @@ TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char*
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, _tcslen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, _tcslen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
@@ -20,12 +20,12 @@ TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, _tcslen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, _tcslen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- _tcsncpy(buf, tmp, min(buflen, _tcslen(tmp)+1));
+ _tcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp
index f37ae252db..0a0b6a77e0 100644
--- a/plugins/Spamotron/src/spamotron.cpp
+++ b/plugins/Spamotron/src/spamotron.cpp
@@ -194,7 +194,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
bCorrectResponse = TRUE;
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (_tcslen(message) == _tcslen(buf)))
+ (mir_tstrlen(message) == mir_tstrlen(buf)))
bCorrectResponse = TRUE;
}
break;
@@ -211,7 +211,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
}
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (_tcslen(message) == _tcslen(buf))) {
+ (mir_tstrlen(message) == mir_tstrlen(buf))) {
bCorrectResponse = TRUE;
break;
}
@@ -223,7 +223,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
if (message == NULL)
break;
_itot(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (_tcsstr(message, buf) && (_tcslen(buf) == _tcslen(message))) {
+ if (_tcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp
index 81d1493fa7..2c8ba48df7 100644
--- a/plugins/Spamotron/src/utils.cpp
+++ b/plugins/Spamotron/src/utils.cpp
@@ -7,7 +7,7 @@ TCHAR *_tcstolower(TCHAR *dst)
if (dst == NULL)
return NULL;
- SIZE_T dst_len = _tcslen(dst);
+ SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
dst[i] = _totlower(dst[i]);
return dst;
@@ -18,7 +18,7 @@ TCHAR *_tcstoupper(TCHAR *dst)
if (dst == NULL)
return NULL;
- SIZE_T dst_len = _tcslen(dst);
+ SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
dst[i] = _totupper(dst[i]);
return dst;
@@ -42,7 +42,7 @@ BOOL _isregex(TCHAR* strSearch)
regex = mir_tstrdup(strSearch);
if (regex == NULL)
goto err_out;
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
if (rc == 3)
ret = TRUE;
mir_free(regex);
@@ -73,7 +73,7 @@ BOOL _isvalidregex(TCHAR* strSearch)
pcre16_free(re);
return FALSE;
}
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
pcre16_free(re);
if (rc != 3)
goto err_out;
@@ -121,7 +121,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
pcre16_free(re);
return FALSE;
}
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
pcre16_free(re);
if (rc != 3)
goto err_out; // [TODO] and log some error (better check for valid regex on options save)
@@ -143,7 +143,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL);
if (re == NULL)
goto err_out;
- rc = pcre16_exec(re, NULL, data, (int)_tcslen(data), 0, 0, NULL, 0);
+ rc = pcre16_exec(re, NULL, data, (int)mir_tstrlen(data), 0, 0, NULL, 0);
pcre16_free(re);
if (rc >= 0)
ret = TRUE;
@@ -175,7 +175,7 @@ int get_response_id(const TCHAR* strvar)
pcre16_free(re);
return 0;
}
- rc = pcre16_exec(re, NULL, _strvar, (int)_tcslen(_strvar), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, _strvar, (int)mir_tstrlen(_strvar), 0, 0, ovector, 9);
pcre16_free(re);
if (rc < 0) {
ret = -1;
@@ -274,10 +274,10 @@ BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from
if (tdst == NULL)
goto err_out;
tdst = _tcstoupper(tdst);
- dst_len = _tcslen(tdst);
+ dst_len = mir_tstrlen(tdst);
token = _tcstok(tsrc, _T(","));
while (token) {
- token_end = (token + _tcslen(token));
+ token_end = (token + mir_tstrlen(token));
while (!_tcsncmp(token, _T(" "), 1)) { /* Skeep spaces at start. */
token ++;
}
@@ -329,9 +329,9 @@ TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *r
if (dst == NULL || var == NULL || rvar == NULL)
return NULL;
- dst_len = _tcslen(dst);
- var_len = _tcslen(var);
- rvar_len = _tcslen(rvar);
+ dst_len = mir_tstrlen(dst);
+ var_len = mir_tstrlen(var);
+ rvar_len = mir_tstrlen(rvar);
var_start = _tcsstr(dst, var);
while (var_start) {
if (len < (dst_len + rvar_len - var_len + 1))
@@ -390,7 +390,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
mir_free(dstcopy);
goto err_out;
}
- rc = pcre16_exec(re, NULL, _str, (int)_tcslen(_str), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, _str, (int)mir_tstrlen(_str), 0, 0, ovector, 9);
if (rc < 0) {
ret = -1;
} else if (rc == 3) {
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
index 8551cf26fa..a65e36e22a 100644
--- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
+++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp
@@ -931,10 +931,10 @@ static int ProcessPopup(int reason, LPARAM lParam)
memset(protoInfo, '\0', sizeof(protoInfo));
_tcscpy(protoInfo, _T("\r\n"));
for (int i = 0; i < connectionSettings.getCount(); i++) {
- if (_tcslen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) {
+ if (mir_tstrlen(ps[i]->tszAccName) > 0 && mir_strlen(ps[i]->szName) > 0) {
if (db_get_b(NULL, MODULENAME, SETTING_PUSHOWEXTRA, TRUE)) {
mir_sntprintf(protoInfoLine, SIZEOF(protoInfoLine), TranslateT("%s\t(will be set to %s)\r\n"), ps[i]->tszAccName, pcli->pfnGetStatusModeDescription(ps[i]->status, GSMDF_TCHAR));
- _tcsncat(protoInfo, protoInfoLine, SIZEOF(protoInfo) - _tcslen(protoInfo) - 1);
+ _tcsncat(protoInfo, protoInfoLine, SIZEOF(protoInfo) - mir_tstrlen(protoInfo) - 1);
}
}
}
diff --git a/plugins/StatusPlugins/StartupStatus/profiles.cpp b/plugins/StatusPlugins/StartupStatus/profiles.cpp
index f9d9ed8d23..7814703f23 100644
--- a/plugins/StatusPlugins/StartupStatus/profiles.cpp
+++ b/plugins/StatusPlugins/StartupStatus/profiles.cpp
@@ -192,7 +192,7 @@ TCHAR *GetStatusMessage(int profile, char *szProto)
if ( (pce[i].profile == profile) && (!strcmp(pce[i].szProto, szProto))) {
mir_snprintf(dbSetting, SIZEOF(dbSetting), "%d_%s_%s", profile, szProto, SETTING_PROFILE_STSMSG);
if (!db_get_ts(NULL, MODULENAME, dbSetting, &dbv)) { // reload from db
- pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(_tcslen(dbv.ptszVal)+1));
+ pce[i].msg = ( TCHAR* )realloc(pce[i].msg, sizeof(TCHAR)*(mir_tstrlen(dbv.ptszVal)+1));
if (pce[i].msg != NULL) {
_tcscpy(pce[i].msg, dbv.ptszVal);
}
diff --git a/plugins/StopSpamMod/src/utilities.cpp b/plugins/StopSpamMod/src/utilities.cpp
index 4e56ea72ef..894d156ad9 100755
--- a/plugins/StopSpamMod/src/utilities.cpp
+++ b/plugins/StopSpamMod/src/utilities.cpp
@@ -121,7 +121,7 @@ tstring variables_parse(tstring const &tstrFormat, MCONTACT hContact){
// case-insensitive _tcscmp
//by nullbie as i remember...
-#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : _tcscpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(_tcslen(A)+1)),A)
+#define NEWTSTR_MALLOC(A) (A==NULL) ? NULL : _tcscpy((TCHAR*)mir_alloc(sizeof(TCHAR)*(mir_tstrlen(A)+1)),A)
const int Stricmp(const TCHAR *str, const TCHAR *substr)
{
int i = 0;
@@ -187,7 +187,7 @@ BOOL IsUrlContains(TCHAR * Str)
L".tv"
};
- if(Str && _tcslen(Str)>0) {
+ if(Str && mir_tstrlen(Str)>0) {
TCHAR *StrLower = NEWTSTR_MALLOC(Str);
CharLowerBuff(StrLower, mir_tstrlen(StrLower));
for (int i=0; i<CountUrl; i++)
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 70270c2132..cc3664024b 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -689,7 +689,7 @@ BOOL IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
if (gce->ptszNick != NULL) {
dwMask |= CMUCHighlight::MATCH_NICKNAME;
if (si && g_Settings.bLogClassicIndicators) {
- size_t len = _tcslen(gce->ptszNick) + 1;
+ size_t len = mir_tstrlen(gce->ptszNick) + 1;
TCHAR *tmp = (TCHAR*)_alloca(sizeof(TCHAR)*(len + 1));
*tmp = GetIndicator(si, gce->ptszNick, 0);
_tcscpy(tmp + 1, gce->ptszNick);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 917c3266c3..bcb1e6d30b 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -451,7 +451,7 @@ static bool TabAutoComplete(HWND hwnd, MESSAGESUBDATA *dat, SESSION_INFO *si)
start -= 2;
if (dat->szSearchResult != NULL) {
- int cbResult = (int)_tcslen(dat->szSearchResult);
+ int cbResult = (int)mir_tstrlen(dat->szSearchResult);
if (start >= cbResult && !_tcsncicmp(dat->szSearchResult, pszText + start - cbResult, cbResult)) {
start -= cbResult;
goto LBL_SkipEnd;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 52e1eef1ad..aa9965f604 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -1924,14 +1924,14 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
return;
}
- if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - _tcslen(mirandatempdir) - _tcslen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
+ if (tempdirlen <= 0 || tempdirlen >= MAX_PATH - mir_tstrlen(mirandatempdir) - mir_tstrlen(filenametemplate) - 2) // -2 is because %Y takes 4 symbols
filename[0] = 0; // prompt for a new name
else {
_tcscpy(filename + tempdirlen, mirandatempdir);
if ((GetFileAttributes(filename) == INVALID_FILE_ATTRIBUTES || ((GetFileAttributes(filename) & FILE_ATTRIBUTE_DIRECTORY) == 0)) && CreateDirectory(filename, NULL) == 0)
filename[0] = 0;
else {
- tempdirlen = _tcslen(filename);
+ tempdirlen = mir_tstrlen(filename);
time_t rawtime;
time(&rawtime);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 6ff4c4c4c2..1342aff813 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -900,7 +900,7 @@ void CThumbMUC::renderContent()
else {
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Server window"));
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
- if (mi->tszIdleMsg[0] && _tcslen(mi->tszIdleMsg) > 2) {
+ if (mi->tszIdleMsg[0] && mir_tstrlen(mi->tszIdleMsg) > 2) {
m_rcIcon.top += m_sz.cy;
CSkin::RenderText(m_hdc, m_dat->hTheme, &mi->tszIdleMsg[2], &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 33f1f2ab27..4c376925b9 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -473,8 +473,8 @@ TCHAR* Utils::GetPreviewWithEllipsis(TCHAR *szText, size_t iMaxLen)
TCHAR *p = 0, cSaved;
bool fEllipsis = false;
- if (_tcslen(szText) <= iMaxLen) {
- uRequired = _tcslen(szText) + 4;
+ if (mir_tstrlen(szText) <= iMaxLen) {
+ uRequired = mir_tstrlen(szText) + 4;
cSaved = 0;
}
else {
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp
index 23eccb1026..495957a6ae 100644
--- a/plugins/TipperYM/src/popwin.cpp
+++ b/plugins/TipperYM/src/popwin.cpp
@@ -28,7 +28,7 @@ __inline void AddRow(PopupWindowData *pwd, TCHAR *swzLabel, TCHAR *swzValue, cha
pwd->rows = pRows;
pwd->rows[pwd->iRowCount].swzLabel = swzLabel ? mir_tstrdup(swzLabel) : NULL;
pwd->rows[pwd->iRowCount].swzValue = swzValue ? mir_tstrdup(swzValue) : NULL;
- pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)_tcslen(swzValue), szProto) : NULL;
+ pwd->rows[pwd->iRowCount].spi = bParseSmileys ? Smileys_PreParse(swzValue, (int)mir_tstrlen(swzValue), szProto) : NULL;
pwd->rows[pwd->iRowCount].bValueNewline = bNewline;
pwd->rows[pwd->iRowCount].bLineAbove = bLineAbove;
pwd->rows[pwd->iRowCount].bIsTitle = bIsTitle;
@@ -76,7 +76,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
_tcscpy(pwd->swzTitle, pa->tszAccountName);
}
- if (_tcslen(pwd->swzTitle) == 0)
+ if (mir_tstrlen(pwd->swzTitle) == 0)
a2t(pwd->clcit.szProto, pwd->swzTitle, TITLE_TEXT_LEN);
if (CallService(MS_PROTO_ISACCOUNTLOCKED, 0, (LPARAM)pwd->clcit.szProto))
@@ -225,7 +225,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
else {
TCHAR buff[2048], *swzText = pwd->clcit.swzText;
- size_t iBuffPos, i = 0, iSize = _tcslen(pwd->clcit.swzText);
+ size_t iBuffPos, i = 0, iSize = mir_tstrlen(pwd->clcit.swzText);
bool bTopMessage = false;
while (i < iSize && swzText[i] != _T('<')) {
@@ -772,7 +772,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
for (int i = 0; i < pwd->iRowCount; i++) {
if (pwd->rows[i].swzValue) {
TCHAR buff[128];
- int iLen = (int)_tcslen(pwd->rows[i].swzValue);
+ int iLen = (int)mir_tstrlen(pwd->rows[i].swzValue);
if (iLen) {
if (iLen > MAX_VALUE_LEN) {
_tcsncpy(buff, pwd->rows[i].swzValue, MAX_VALUE_LEN);
@@ -1066,7 +1066,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd->rows[pwd->iRowCount].swzLabel = mir_tstrdup(buff_label);
pwd->rows[pwd->iRowCount].swzValue = mir_tstrdup(buff);
- pwd->rows[pwd->iRowCount].spi = Smileys_PreParse(buff, (int)_tcslen(buff), szProto);
+ pwd->rows[pwd->iRowCount].spi = Smileys_PreParse(buff, (int)mir_tstrlen(buff), szProto);
pwd->rows[pwd->iRowCount].bValueNewline = node->di.bValueNewline;
pwd->rows[pwd->iRowCount].bLineAbove = node->di.bLineAbove;
pwd->iRowCount++;
@@ -1183,7 +1183,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
else if (hFontLabels)
SelectObject(hdc, (HGDIOBJ)hFontLabels);
- GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)_tcslen(pwd->rows[i].swzLabel), &sz);
+ GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_tstrlen(pwd->rows[i].swzLabel), &sz);
if (sz.cx > pwd->iLabelWidth)
pwd->iLabelWidth = sz.cx;
}
@@ -1198,7 +1198,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
SelectObject(hdc, (HGDIOBJ)hFontLabels);
if (pwd->rows[i].swzLabel && pwd->rows[i].swzLabel[0])
- GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)_tcslen(pwd->rows[i].swzLabel), &sz);
+ GetTextExtentPoint32(hdc, pwd->rows[i].swzLabel, (int)mir_tstrlen(pwd->rows[i].swzLabel), &sz);
else
sz.cy = sz.cx = 0;
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp
index f93448d397..a36d2fed36 100644
--- a/plugins/TipperYM/src/skin_parser.cpp
+++ b/plugins/TipperYM/src/skin_parser.cpp
@@ -206,7 +206,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff)
{
if (GetSettingName(buff, "", szSetting, sizeof(szSetting) - 1))
{
- if (_tcslen(pch) > 32)
+ if (mir_tstrlen(pch) > 32)
pch[32] = 0;
db_set_ts(0, MODULE, szSetting, pch);
diff --git a/plugins/TipperYM/src/str_utils.cpp b/plugins/TipperYM/src/str_utils.cpp
index a79cb3b351..b6b605c7de 100644
--- a/plugins/TipperYM/src/str_utils.cpp
+++ b/plugins/TipperYM/src/str_utils.cpp
@@ -195,7 +195,7 @@ char *t2utf(const TCHAR *ts)
TCHAR *myfgets(TCHAR *Buf, int MaxCount, FILE *File)
{
_fgetts(Buf, MaxCount, File);
- for (size_t i = _tcslen(Buf) - 1; ; i--)
+ for (size_t i = mir_tstrlen(Buf) - 1; ; i--)
{
if (Buf[i] == '\n' || Buf[i] == ' ')
Buf[i] = 0;
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp
index 9d4c23a4ec..31fa26a4a3 100644
--- a/plugins/TipperYM/src/subst.cpp
+++ b/plugins/TipperYM/src/subst.cpp
@@ -85,7 +85,7 @@ void StripBBCodesInPlace(TCHAR *swzText)
return;
size_t iRead = 0, iWrite = 0;
- size_t iLen = _tcslen(swzText);
+ size_t iLen = mir_tstrlen(swzText);
while(iRead <= iLen) { // copy terminating null too
while (iRead <= iLen && swzText[iRead] != '[') {
@@ -225,7 +225,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact)
return NULL;
if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -237,7 +237,7 @@ TCHAR* GetStatusMessageText(MCONTACT hContact)
return NULL;
if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -480,7 +480,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
// pass to variables plugin if available
TCHAR *swzVarSrc = (parseTipperVarsFirst ? mir_tstrdup(swzSource) : variables_parsedup((TCHAR *)swzSource, 0, hContact));
- size_t iSourceLen = _tcslen(swzVarSrc);
+ size_t iSourceLen = mir_tstrlen(swzVarSrc);
size_t si = 0, di = 0, v = 0;
TCHAR swzVName[LABEL_LEN], swzRep[VALUE_LEN], swzAlt[VALUE_LEN];
@@ -558,13 +558,13 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
if (p) {
*p = 0; // clip swzAlt from swzVName
p++;
- if (_tcslen(p) > 4 && _tcsncmp(p, _T("raw:"), 4) == 0) { // raw db substitution
+ if (mir_tstrlen(p) > 4 && _tcsncmp(p, _T("raw:"), 4) == 0) { // raw db substitution
char raw_spec[LABEL_LEN];
p += 4;
t2a(p, raw_spec, LABEL_LEN);
GetRawSubstText(hContact, raw_spec, swzAlt, VALUE_LEN);
}
- else if (_tcslen(p) > 4 && _tcsncmp(p, _T("sys:"), 4) == 0) { // 'system' substitution
+ else if (mir_tstrlen(p) > 4 && _tcsncmp(p, _T("sys:"), 4) == 0) { // 'system' substitution
p += 4;
GetSysSubstText(hContact, p, swzAlt, VALUE_LEN);
}
@@ -586,7 +586,7 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
}
swzAlt[VALUE_LEN - 1] = 0;
- if (_tcslen(swzAlt) != 0)
+ if (mir_tstrlen(swzAlt) != 0)
bAltSubst = true;
}
@@ -618,12 +618,12 @@ bool ApplySubst(MCONTACT hContact, const TCHAR *swzSource, bool parseTipperVarsF
}
if (bSubst) {
- size_t rep_len = _tcslen(swzRep);
+ size_t rep_len = mir_tstrlen(swzRep);
_tcsncpy(&swzDest[di], swzRep, min(rep_len, iDestLen - di));
di += rep_len - 1; // -1 because we inc at bottom of loop
}
else if (bAltSubst) {
- size_t alt_len = _tcslen(swzAlt);
+ size_t alt_len = mir_tstrlen(swzAlt);
_tcsncpy(&swzDest[di], swzAlt, min(alt_len, iDestLen - di));
di += alt_len - 1; // -1 because we inc at bottom of loop
}
@@ -680,7 +680,7 @@ bool GetValueText(MCONTACT hContact, const DISPLAYITEM &di, TCHAR *buff, size_t
void TruncateString(TCHAR *swzText)
{
if (swzText && opt.iLimitCharCount > 3) {
- if ((int)_tcslen(swzText) > opt.iLimitCharCount) {
+ if ((int)mir_tstrlen(swzText) > opt.iLimitCharCount) {
swzText[opt.iLimitCharCount - 3] = 0;
_tcscat(swzText, _T("..."));
}
@@ -731,7 +731,7 @@ TCHAR *GetProtoExtraStatusTitle(char *szProto)
return NULL;
if (!db_get_ts(0, szProto, "XStatusName", &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -756,7 +756,7 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto)
TCHAR *swzText = NULL;
DBVARIANT dbv;
if (!db_get_ts(0, szProto, "XStatusMsg", &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -794,7 +794,7 @@ TCHAR *GetListeningTo(char *szProto)
return NULL;
if (!db_get_ts(0, szProto, "ListeningTo", &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -816,7 +816,7 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV
char szSetting[128];
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
if (!db_get_ts(0, "AdvStatus", szSetting, &dbv)) {
- if (_tcslen(dbv.ptszVal) != 0)
+ if (mir_tstrlen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp
index ff655894f6..e1ab66d706 100644
--- a/plugins/TooltipNotify/src/TooltipNotify.cpp
+++ b/plugins/TooltipNotify/src/TooltipNotify.cpp
@@ -920,8 +920,8 @@ TCHAR *CTooltipNotify::MakeTooltipString(MCONTACT hContact, int iStatus, TCHAR *
mir_sntprintf(szString, iBufSize - 1, szFormatString, wszProto, _T(": "), szContactName);
- TruncateWithDots(szString, iBufSize-1-_tcslen(szStatus)-_tcslen(szIs)-2); // 2 spaces around szIs
- mir_sntprintf(szString + _tcslen(szString), iBufSize - 1 - _tcslen(szString), _T(" %s %s"), szIs, szStatus);
+ TruncateWithDots(szString, iBufSize-1-mir_tstrlen(szStatus)-mir_tstrlen(szIs)-2); // 2 spaces around szIs
+ mir_sntprintf(szString + mir_tstrlen(szString), iBufSize - 1 - mir_tstrlen(szString), _T(" %s %s"), szIs, szStatus);
return szString;
}
diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp
index 63b981bb78..0142470143 100644
--- a/plugins/TooltipNotify/src/Utils.cpp
+++ b/plugins/TooltipNotify/src/Utils.cpp
@@ -15,7 +15,7 @@ BOOL IsNt50()
void TruncateWithDots(TCHAR* szString, size_t iNewLen)
{
- size_t iOrigLen = _tcslen(szString);
+ size_t iOrigLen = mir_tstrlen(szString);
if (iNewLen < iOrigLen) {
TCHAR* p = szString+iNewLen;
*p = _T('\0');
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp
index 4749b7f457..724dba4b04 100644
--- a/plugins/TrafficCounter/src/TrafficCounter.cpp
+++ b/plugins/TrafficCounter/src/TrafficCounter.cpp
@@ -1180,7 +1180,7 @@ void CreateProtocolList(void)
{
ProtoList[i].name = (char*)mir_alloc(mir_strlen(acc[i]->szModuleName) + 1);
strcpy(ProtoList[i].name, acc[i]->szModuleName);
- ProtoList[i].tszAccountName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (1 + _tcslen(acc[i]->tszAccountName)));
+ ProtoList[i].tszAccountName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (1 + mir_tstrlen(acc[i]->tszAccountName)));
_tcscpy(ProtoList[i].tszAccountName, acc[i]->tszAccountName);
//
ProtoList[i].Flags = db_get_b(NULL, ProtoList[i].name, SETTINGS_PROTO_FLAGS, 3);
diff --git a/plugins/TrafficCounter/src/misc.cpp b/plugins/TrafficCounter/src/misc.cpp
index 4b51e25056..72bb146280 100644
--- a/plugins/TrafficCounter/src/misc.cpp
+++ b/plugins/TrafficCounter/src/misc.cpp
@@ -66,9 +66,9 @@ WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList)
else
{
// Âûäåëÿåì ïàìÿòü ïîä ñòðîêó.
- (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * _tcslen(end));
+ (*RowItemsList)[c].String = (TCHAR*)mir_alloc(sizeof(TCHAR) * mir_tstrlen(end));
// Êîïèðóåì ñòðîêó.
- _tcsncpy((*RowItemsList)[c].String, end + 1, _tcslen(end));
+ _tcsncpy((*RowItemsList)[c].String, end + 1, mir_tstrlen(end));
}
c++;
@@ -156,7 +156,7 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
mir_sntprintf(Str1, SIZEOF(Str1), _T("%d.%d"), Value / Divider, Value % Divider);
size_t l = GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, NULL, 0);
if (!l) return 0;
- l += _tcslen(szUnit) + 1;
+ l += mir_tstrlen(szUnit) + 1;
Res = (TCHAR*)malloc(l * sizeof(TCHAR));
if (!Res) return 0;
GetNumberFormat(LOCALE_USER_DEFAULT, 0, Str1, &nf, Res, l);
@@ -165,11 +165,11 @@ size_t GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, size_t Size)
if (Size && Buffer)
{
_tcscpy(Buffer, Res);
- l = _tcslen(Buffer);
+ l = mir_tstrlen(Buffer);
}
else
{
- l = _tcslen(Res) + 1;
+ l = mir_tstrlen(Res) + 1;
}
free(Res);
@@ -257,7 +257,7 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Siz
}
// Äîáàâèì ïàìÿòè, åñëè íóæíî.
- Length = _tcslen(Res) + _tcslen(Token) + 1;
+ Length = mir_tstrlen(Res) + mir_tstrlen(Token) + 1;
Res = (TCHAR*)realloc(Res, Length * sizeof(TCHAR));
_tcscat(Res, Token);
}
@@ -265,11 +265,11 @@ size_t GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Siz
if (Size && Buffer)
{
_tcsncpy(Buffer, Res, Size);
- Length = _tcslen(Buffer);
+ Length = mir_tstrlen(Buffer);
}
else
{
- Length = _tcslen(Res) + 1;
+ Length = mir_tstrlen(Res) + 1;
}
free(Res);
diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp
index bdbd4cfd6c..76f0f433df 100644
--- a/plugins/TrafficCounter/src/options.cpp
+++ b/plugins/TrafficCounter/src/options.cpp
@@ -194,7 +194,7 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
{
options[i].szSettingName = (char*)mir_alloc(1 + mir_strlen(ProtoList[j].name));
strcpy(options[i].szSettingName, ProtoList[j].name);
- size_t l = 20 + _tcslen(ProtoList[j].tszAccountName);
+ size_t l = 20 + mir_tstrlen(ProtoList[j].tszAccountName);
options[i].szOptionName = (TCHAR*)mir_alloc(sizeof(TCHAR) * l);
mir_sntprintf(options[i].szOptionName, l, _T("Visible accounts/%s"), ProtoList[j].tszAccountName);
options[i].dwFlag = (ProtoList[j++].Enabled ? 1 : OPTTREE_INVISIBLE) | OPTTREE_NOTRANSLATE;
diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp
index 33e0181457..ca1b05925a 100644
--- a/plugins/UserGuide/src/main.cpp
+++ b/plugins/UserGuide/src/main.cpp
@@ -44,12 +44,12 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM)
if (pszDivider == NULL)
{
_tcscpy(pszDirName, _T(""));
- _tcsncpy(pszFileName, ptszHelpFile, _tcslen(ptszHelpFile));
+ _tcsncpy(pszFileName, ptszHelpFile, mir_tstrlen(ptszHelpFile));
}
else
{
- _tcsncpy(pszFileName, pszDivider + 1, _tcslen(ptszHelpFile) - _tcslen(pszDivider) - 1);
- pszFileName[_tcslen(ptszHelpFile) - _tcslen(pszDivider) - 1] = 0;
+ _tcsncpy(pszFileName, pszDivider + 1, mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1);
+ pszFileName[mir_tstrlen(ptszHelpFile) - mir_tstrlen(pszDivider) - 1] = 0;
_tcsncpy(pszDirName, ptszHelpFile, pszDivider - ptszHelpFile);
pszDirName[pszDivider - ptszHelpFile] = 0;
}
diff --git a/plugins/UserInfoEx/src/ctrl_contact.cpp b/plugins/UserInfoEx/src/ctrl_contact.cpp
index 4ed530558f..a3d22c6061 100644
--- a/plugins/UserInfoEx/src/ctrl_contact.cpp
+++ b/plugins/UserInfoEx/src/ctrl_contact.cpp
@@ -1463,7 +1463,7 @@ int CtrlContactWriteMyItemsToDB(
if (!hContact && !(pszModule = pszProto)) return 1;
pszOther = TranslateT("Other");
- ccOther = _tcslen(pszOther);
+ ccOther = mir_tstrlen(pszOther);
cbi.wMask = CBEXIM_CAT|CBEXIM_VAL|CBEXIM_FLAGS;
cbi.pszCat = szCat;
cbi.ccCat = MAX_CAT;
diff --git a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
index ffc2423ca2..b67b99b966 100644
--- a/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
+++ b/plugins/UserInfoEx/src/ex_import/svc_ExImport.cpp
@@ -280,7 +280,7 @@ INT_PTR svcExIm_Group_Service(WPARAM wParam, LPARAM lParam)
if (SendMessage(hClist,CLM_GETITEMTYPE, (WPARAM)hItem, 0) == CLCIT_GROUP) {
SendMessage(hClist,CLM_GETITEMTEXT, (WPARAM)hItem, (LPARAM)ptszItem);
LPTSTR temp = mir_tstrdup(ptszGroup);
- mir_sntprintf(tszGroup, SIZEOF(tszGroup),_T("%s%s%s"), ptszItem, _tcslen(temp)? _T("\\"):_T(""), temp);
+ mir_sntprintf(tszGroup, SIZEOF(tszGroup),_T("%s%s%s"), ptszItem, mir_tstrlen(temp)? _T("\\"):_T(""), temp);
mir_free (temp);
}
hParent = SendMessage(hClist,CLM_GETNEXTITEM, (WPARAM)CLGN_PARENT, (LPARAM)hItem);
diff --git a/plugins/UserInfoEx/src/psp_origin.cpp b/plugins/UserInfoEx/src/psp_origin.cpp
index 5d435f4e7d..d7582ca475 100644
--- a/plugins/UserInfoEx/src/psp_origin.cpp
+++ b/plugins/UserInfoEx/src/psp_origin.cpp
@@ -95,7 +95,7 @@ INT_PTR CALLBACK PSPProcOrigin(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
mt.DateFormatLong(szTime, SIZEOF(szTime));
_tcscat(szTime, _T(" - "));
- ptr = szTime + _tcslen(szTime);
+ ptr = szTime + mir_tstrlen(szTime);
mt.TimeFormat(ptr, SIZEOF(szTime) - (ptr - szTime));
SetDlgItemText(hDlg, TXT_DATEADDED, szTime);
}
diff --git a/plugins/Variables/src/contact.cpp b/plugins/Variables/src/contact.cpp
index 5ccc20cea5..cbb70481bc 100644
--- a/plugins/Variables/src/contact.cpp
+++ b/plugins/Variables/src/contact.cpp
@@ -91,7 +91,7 @@ static HANDLE hContactSettingChangedHook;
*/
BYTE getContactInfoType(TCHAR* type)
{
- if (type == NULL || _tcslen(type) == 0 )
+ if (type == NULL || mir_tstrlen(type) == 0 )
return 0;
for (int i=0; i < SIZEOF(builtinCnfs); i++ )
@@ -206,7 +206,7 @@ int getContactFromString(CONTACTSINFO *ci)
tszContact = NEWTSTR_ALLOCA(tmp);
mir_free(tmp);
}
- if ((tszContact == NULL) || (_tcslen(tszContact) == 0))
+ if ((tszContact == NULL) || (mir_tstrlen(tszContact) == 0))
return -1;
ci->hContacts = NULL;
@@ -234,12 +234,12 @@ int getContactFromString(CONTACTSINFO *ci)
BOOL bMatch = FALSE;
// <_HANDLE_:hContact>
- size_t size = _tcslen(_T(PROTOID_HANDLE)) + 36;
+ size_t size = mir_tstrlen(_T(PROTOID_HANDLE)) + 36;
szFind = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (szFind != NULL)
{
mir_sntprintf(szFind, size, _T("<%s:%p>"), _T(PROTOID_HANDLE), hContact);
- if (!_tcsncmp(tszContact, szFind, _tcslen(tszContact)))
+ if (!_tcsncmp(tszContact, szFind, mir_tstrlen(tszContact)))
bMatch = TRUE;
mir_free(szFind);
@@ -255,12 +255,12 @@ int getContactFromString(CONTACTSINFO *ci)
TCHAR *cInfo = getContactInfoT(CNF_UNIQUEID, hContact);
if (cInfo)
{
- size_t size = _tcslen(cInfo) + mir_strlen(szProto) + 4;
+ size_t size = mir_tstrlen(cInfo) + mir_strlen(szProto) + 4;
szFind = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (szFind != NULL) {
mir_sntprintf(szFind, size, _T("<%S:%s>"), szProto, cInfo);
mir_free(cInfo);
- if (!_tcsncmp(tszContact, szFind, _tcslen(tszContact)))
+ if (!_tcsncmp(tszContact, szFind, mir_tstrlen(tszContact)))
bMatch = TRUE;
mir_free(szFind);
}
@@ -416,7 +416,7 @@ TCHAR* encodeContactToString(MCONTACT hContact)
if (szProto == NULL || tszUniqueId == NULL)
return NULL;
- size_t size = _tcslen(tszUniqueId) + mir_strlen(szProto) + 4;
+ size_t size = mir_tstrlen(tszUniqueId) + mir_strlen(szProto) + 4;
TCHAR *tszResult = (TCHAR *)mir_calloc(size * sizeof(TCHAR));
if (tszResult)
mir_sntprintf(tszResult, size, _T("<%S:%s>"), szProto, tszUniqueId);
diff --git a/plugins/Variables/src/help.cpp b/plugins/Variables/src/help.cpp
index a76a3a15e9..49f3de4fa7 100644
--- a/plugins/Variables/src/help.cpp
+++ b/plugins/Variables/src/help.cpp
@@ -314,7 +314,7 @@ static TCHAR *getTokenDescription(TOKENREGISTEREX *tr)
}
else args = NULL;
- size_t len = _tcslen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3;
+ size_t len = mir_tstrlen(tr->tszTokenString) + (args!=NULL?mir_strlen(args):0) + 3;
TCHAR *desc = (TCHAR*)mir_calloc(len * sizeof(TCHAR));
if (desc == NULL) {
mir_free(helpText);
@@ -484,7 +484,7 @@ static BOOL CALLBACK processTokenListMessage(HWND hwndDlg, UINT msg, WPARAM wPar
if (tr == NULL)
break;
- size_t len = _tcslen(tr->tszTokenString) + 2;
+ size_t len = mir_tstrlen(tr->tszTokenString) + 2;
TCHAR *tokenString = (TCHAR*)mir_alloc((len+1)*sizeof(TCHAR));
if (tokenString == NULL)
break;
diff --git a/plugins/Variables/src/parse_alias.cpp b/plugins/Variables/src/parse_alias.cpp
index 557f5be2eb..87256051f5 100644
--- a/plugins/Variables/src/parse_alias.cpp
+++ b/plugins/Variables/src/parse_alias.cpp
@@ -45,7 +45,7 @@ static ALIASREGISTER *searchAliasRegister(TCHAR *szAlias)
static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
{
- if (_tcslen(tArg) == 0)
+ if (mir_tstrlen(tArg) == 0)
return res;
unsigned int cur = 0, ecur = 0;
@@ -55,14 +55,14 @@ static TCHAR *replaceArguments(TCHAR *res, TCHAR *tArg, TCHAR *rArg)
while ((*(res + ecur) != ')') && (*(res + ecur) != ','))
ecur++;
- if (((signed int)_tcslen(tArg) == (ecur - cur)) && (!_tcsncmp(tArg, res + cur, _tcslen(tArg)))) {
- if (_tcslen(rArg) > _tcslen(tArg)) {
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + (_tcslen(rArg) - _tcslen(tArg)) + 1)*sizeof(TCHAR));
+ if (((signed int)mir_tstrlen(tArg) == (ecur - cur)) && (!_tcsncmp(tArg, res + cur, mir_tstrlen(tArg)))) {
+ if (mir_tstrlen(rArg) > mir_tstrlen(tArg)) {
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + (mir_tstrlen(rArg) - mir_tstrlen(tArg)) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
}
- memmove(res + ecur + (_tcslen(rArg) - _tcslen(tArg)), res + ecur, (_tcslen(res + ecur) + 1)*sizeof(TCHAR));
- _tcsncpy(res + cur, rArg, _tcslen(rArg));
+ memmove(res + ecur + (mir_tstrlen(rArg) - mir_tstrlen(tArg)), res + ecur, (mir_tstrlen(res + ecur) + 1)*sizeof(TCHAR));
+ _tcsncpy(res + cur, rArg, mir_tstrlen(rArg));
}
}
cur++;
@@ -89,7 +89,7 @@ static TCHAR *parseTranslateAlias(ARGUMENTSINFO *ai)
static int addToAliasRegister(TCHAR *szAlias, unsigned int argc, TCHAR** argv, TCHAR *szTranslation)
{
- if (szAlias == NULL || szTranslation == NULL || _tcslen(szAlias) == 0)
+ if (szAlias == NULL || szTranslation == NULL || mir_tstrlen(szAlias) == 0)
return -1;
mir_cslock lck(csAliasRegister);
@@ -156,9 +156,9 @@ static TCHAR *parseAddAlias(ARGUMENTSINFO *ai)
TCHAR *szArgs = NULL;
for (int i = 0; i < argc; i++) {
if (i == 0)
- szArgs = (TCHAR*)mir_calloc((_tcslen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (TCHAR*)mir_calloc((mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
else
- szArgs = (TCHAR*)mir_realloc(szArgs, (_tcslen(szArgs) + _tcslen(argv[i]) + 2)*sizeof(TCHAR));
+ szArgs = (TCHAR*)mir_realloc(szArgs, (mir_tstrlen(szArgs) + mir_tstrlen(argv[i]) + 2)*sizeof(TCHAR));
_tcscat(szArgs, argv[i]);
if (i != argc - 1)
diff --git a/plugins/Variables/src/parse_external.cpp b/plugins/Variables/src/parse_external.cpp
index 47aefa0410..4aec50a9ee 100644
--- a/plugins/Variables/src/parse_external.cpp
+++ b/plugins/Variables/src/parse_external.cpp
@@ -37,13 +37,13 @@ static TCHAR *getFullWinampTitleText()
mir_free(szWinText);
return NULL;
}
- TCHAR *szTitle = (TCHAR*)mir_alloc((2 * _tcslen(szWinText) + 1)*sizeof(TCHAR));
+ TCHAR *szTitle = (TCHAR*)mir_alloc((2 * mir_tstrlen(szWinText) + 1)*sizeof(TCHAR));
if (szTitle == NULL) {
mir_free(szWinText);
return NULL;
}
_tcscpy(szTitle, szWinText);
- _tcscpy(szTitle + _tcslen(szTitle), szWinText);
+ _tcscpy(szTitle + mir_tstrlen(szTitle), szWinText);
mir_free(szWinText);
return szTitle;
@@ -61,7 +61,7 @@ static TCHAR *parseWinampSong(ARGUMENTSINFO *ai)
TCHAR *scur = _tcschr(szTitle, '.');
TCHAR *cur;
- if ((scur == NULL) || ((cur = _tcsstr(scur, _T(" - Winamp"))) == NULL) || (scur >= cur) || (scur > (szTitle + _tcslen(szTitle) - 2)) || (cur > (szTitle + _tcslen(szTitle)))) {
+ if ((scur == NULL) || ((cur = _tcsstr(scur, _T(" - Winamp"))) == NULL) || (scur >= cur) || (scur > (szTitle + mir_tstrlen(szTitle) - 2)) || (cur > (szTitle + mir_tstrlen(szTitle)))) {
mir_free(szTitle);
return NULL;
}
diff --git a/plugins/Variables/src/parse_logic.cpp b/plugins/Variables/src/parse_logic.cpp
index 9ce10a3a92..ec1c70e2a3 100644
--- a/plugins/Variables/src/parse_logic.cpp
+++ b/plugins/Variables/src/parse_logic.cpp
@@ -150,7 +150,7 @@ static TCHAR *parseIflonger(ARGUMENTSINFO *ai)
if (tszFirst == NULL || tszSecond == NULL)
return NULL;
- if (_tcslen(tszFirst) > _tcslen(tszSecond))
+ if (mir_tstrlen(tszFirst) > mir_tstrlen(tszSecond))
return mir_tstrdup(ai->targv[3]);
return mir_tstrdup(ai->targv[4]);
@@ -180,13 +180,13 @@ static TCHAR *parseFor(ARGUMENTSINFO *ai)
TCHAR *parsed = formatString(&fi);
if (parsed != NULL) {
if (res == NULL) {
- res = (TCHAR*)mir_alloc(_tcslen(parsed) + 1 * sizeof(TCHAR));
+ res = (TCHAR*)mir_alloc(mir_tstrlen(parsed) + 1 * sizeof(TCHAR));
if (res == NULL) {
mir_free(parsed);
return NULL;
}
}
- else res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(parsed) + 1)*sizeof(TCHAR));
+ else res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(parsed) + 1)*sizeof(TCHAR));
_tcscat(res, parsed);
mir_free(parsed);
@@ -228,7 +228,7 @@ static TCHAR *parseLonger(ARGUMENTSINFO *ai)
if (ai->argc != 3)
return NULL;
- if (_tcslen(ai->targv[1]) <= _tcslen(ai->targv[2]))
+ if (mir_tstrlen(ai->targv[1]) <= mir_tstrlen(ai->targv[2]))
ai->flags |= AIF_FALSE;
return mir_tstrdup(_T(""));
diff --git a/plugins/Variables/src/parse_math.cpp b/plugins/Variables/src/parse_math.cpp
index 54820e48f1..2581828c28 100644
--- a/plugins/Variables/src/parse_math.cpp
+++ b/plugins/Variables/src/parse_math.cpp
@@ -55,12 +55,12 @@ static TCHAR *parseHex(ARGUMENTSINFO *ai)
int val = ttoi(ai->targv[1]);
int padding = ttoi(ai->targv[2]);
mir_sntprintf(szVal, SIZEOF(szVal), _T("%x"), val);
- unsigned int zeros = max(padding - (signed int)_tcslen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + _tcslen(szVal) + 3)*sizeof(TCHAR));
+ unsigned int zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
+ TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 3)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((zeros + _tcslen(szVal) + 3) * sizeof(TCHAR)));
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 3) * sizeof(TCHAR)));
_tcscpy(res, _T("0x"));
for (i = 0; i < zeros; i++)
*(res + 2 + i) = '0';
@@ -140,14 +140,14 @@ static TCHAR *parseNum(ARGUMENTSINFO *ai)
if (szVal == NULL)
return NULL;
- unsigned zeros = max(padding - (signed int)_tcslen(szVal), 0);
- TCHAR *res = (TCHAR*)mir_alloc((zeros + _tcslen(szVal) + 1)*sizeof(TCHAR));
+ unsigned zeros = max(padding - (signed int)mir_tstrlen(szVal), 0);
+ TCHAR *res = (TCHAR*)mir_alloc((zeros + mir_tstrlen(szVal) + 1)*sizeof(TCHAR));
if (res == NULL) {
mir_free(szVal);
return NULL;
}
- memset(res, 0, ((zeros + _tcslen(szVal) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((zeros + mir_tstrlen(szVal) + 1) * sizeof(TCHAR)));
TCHAR *cur = res;
for (unsigned i = 0; i < zeros; i++)
*cur++ = '0';
diff --git a/plugins/Variables/src/parse_miranda.cpp b/plugins/Variables/src/parse_miranda.cpp
index a60aa9871a..e0efa6e192 100644
--- a/plugins/Variables/src/parse_miranda.cpp
+++ b/plugins/Variables/src/parse_miranda.cpp
@@ -35,34 +35,34 @@ static TCHAR* parseCodeToStatus(ARGUMENTSINFO *ai)
static int getContactInfoFlags(TCHAR *tszDesc)
{
int flags = 0;
- for (TCHAR *cur = tszDesc; (cur < (tszDesc + _tcslen(tszDesc))); cur++) {
- if (!_tcsnicmp(cur, STR_PROTOID, _tcslen(STR_PROTOID))) {
+ for (TCHAR *cur = tszDesc; (cur < (tszDesc + mir_tstrlen(tszDesc))); cur++) {
+ if (!_tcsnicmp(cur, STR_PROTOID, mir_tstrlen(STR_PROTOID))) {
flags |= CI_PROTOID;
- cur += _tcslen(STR_PROTOID) - 1;
+ cur += mir_tstrlen(STR_PROTOID) - 1;
}
- else if (!_tcsnicmp(cur, STR_NICK, _tcslen(STR_NICK))) {
+ else if (!_tcsnicmp(cur, STR_NICK, mir_tstrlen(STR_NICK))) {
flags |= CI_NICK;
- cur += _tcslen(STR_NICK) - 1;
+ cur += mir_tstrlen(STR_NICK) - 1;
}
- else if (!_tcsnicmp(cur, STR_FIRSTNAME, _tcslen(STR_FIRSTNAME))) {
+ else if (!_tcsnicmp(cur, STR_FIRSTNAME, mir_tstrlen(STR_FIRSTNAME))) {
flags |= CI_FIRSTNAME;
- cur += _tcslen(STR_FIRSTNAME) - 1;
+ cur += mir_tstrlen(STR_FIRSTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_LASTNAME, _tcslen(STR_LASTNAME))) {
+ else if (!_tcsnicmp(cur, STR_LASTNAME, mir_tstrlen(STR_LASTNAME))) {
flags |= CI_LASTNAME;
- cur += _tcslen(STR_LASTNAME) - 1;
+ cur += mir_tstrlen(STR_LASTNAME) - 1;
}
- else if (!_tcsnicmp(cur, STR_DISPLAY, _tcslen(STR_DISPLAY))) {
+ else if (!_tcsnicmp(cur, STR_DISPLAY, mir_tstrlen(STR_DISPLAY))) {
flags |= CI_LISTNAME;
- cur += _tcslen(STR_DISPLAY) - 1;
+ cur += mir_tstrlen(STR_DISPLAY) - 1;
}
- else if (!_tcsnicmp(cur, STR_EMAIL, _tcslen(STR_EMAIL))) {
+ else if (!_tcsnicmp(cur, STR_EMAIL, mir_tstrlen(STR_EMAIL))) {
flags |= CI_EMAIL;
- cur += _tcslen(STR_EMAIL) - 1;
+ cur += mir_tstrlen(STR_EMAIL) - 1;
}
- else if (!_tcsnicmp(cur, STR_UNIQUEID, _tcslen(STR_UNIQUEID))) {
+ else if (!_tcsnicmp(cur, STR_UNIQUEID, mir_tstrlen(STR_UNIQUEID))) {
flags |= CI_UNIQUEID;
- cur += _tcslen(STR_UNIQUEID) - 1;
+ cur += mir_tstrlen(STR_UNIQUEID) - 1;
}
}
if (flags == 0) {
@@ -210,7 +210,7 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai)
return NULL;
MCONTACT hContact = NULL;
- if (_tcslen(ai->targv[1]) > 0) {
+ if (mir_tstrlen(ai->targv[1]) > 0) {
CONTACTSINFO ci = { 0 };
ci.cbSize = sizeof(ci);
ci.tszContact = ai->targv[1];
@@ -236,7 +236,7 @@ static TCHAR* parseDBSetting(ARGUMENTSINFO *ai)
return NULL;
}
- TCHAR *szDefaultValue = ((ai->argc > 4 && _tcslen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
+ TCHAR *szDefaultValue = ((ai->argc > 4 && mir_tstrlen(ai->targv[4]) > 0) ? mir_tstrdup(ai->targv[4]) : NULL);
TCHAR *res = getDBSetting(hContact, szModule, szSetting, szDefaultValue);
mir_free(szDefaultValue);
mir_free(szSetting);
@@ -265,7 +265,7 @@ static TCHAR* parseLastSeenDate(ARGUMENTSINFO *ai)
}
TCHAR *szFormat;
- if (ai->argc == 2 || (ai->argc > 2 && _tcslen(ai->targv[2]) == 0))
+ if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -319,7 +319,7 @@ static TCHAR* parseLastSeenTime(ARGUMENTSINFO *ai)
}
TCHAR *szFormat;
- if (ai->argc == 2 || (ai->argc > 2 && _tcslen(ai->targv[2]) == 0))
+ if (ai->argc == 2 || (ai->argc > 2 && mir_tstrlen(ai->targv[2]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -402,7 +402,7 @@ static TCHAR* parseMyStatus(ARGUMENTSINFO *ai)
return NULL;
int status;
- if (ai->argc == 1 || _tcslen(ai->targv[1]) == 0)
+ if (ai->argc == 1 || mir_tstrlen(ai->targv[1]) == 0)
status = CallService(MS_CLIST_GETSTATUSMODE, 0, 0);
else
status = CallProtoService(_T2A(ai->targv[1]), PS_GETSTATUS, 0, 0);
@@ -475,7 +475,7 @@ static TCHAR* parseSpecialContact(ARGUMENTSINFO *ai)
if (szUniqueID == NULL)
return NULL;
- size_t size = mir_strlen(szProto) + _tcslen(szUniqueID) + 4;
+ size_t size = mir_strlen(szProto) + mir_tstrlen(szUniqueID) + 4;
TCHAR *res = (TCHAR*)mir_alloc(size * sizeof(TCHAR));
if (res == NULL)
return NULL;
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp
index 0f6cb00b0d..cd61ae483d 100644
--- a/plugins/Variables/src/parse_str.cpp
+++ b/plugins/Variables/src/parse_str.cpp
@@ -84,9 +84,9 @@ static TCHAR *parseEolToCrlf(ARGUMENTSINFO *ai)
log_debug(cur);
int loc = cur - res;
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 2)*sizeof(TCHAR));
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 2)*sizeof(TCHAR));
cur = res + loc;
- memmove(cur + 2, cur + 1, (_tcslen(cur + 1) + 1)*sizeof(TCHAR));
+ memmove(cur + 2, cur + 1, (mir_tstrlen(cur + 1) + 1)*sizeof(TCHAR));
memcpy(cur, _T("\r\n"), 2 * sizeof(TCHAR));
cur += 2;
}
@@ -113,7 +113,7 @@ static TCHAR *parseFixeol(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[1]);
cur--;
- TCHAR *res = (TCHAR*)mir_alloc((cur - ai->targv[1] + _tcslen(szReplacement) + 1)*sizeof(TCHAR));
+ TCHAR *res = (TCHAR*)mir_alloc((cur - ai->targv[1] + mir_tstrlen(szReplacement) + 1)*sizeof(TCHAR));
if (res == NULL)
return res;
@@ -133,26 +133,26 @@ static TCHAR *parseFixeol2(ARGUMENTSINFO *ai)
}
TCHAR *res = mir_tstrdup(ai->targv[1]);
- for (size_t pos = 0; pos < _tcslen(res); pos++) {
+ for (size_t pos = 0; pos < mir_tstrlen(res); pos++) {
TCHAR *cur = res + pos;
TCHAR *szEol = NULL;
- if (!_tcsncmp(cur, _T("\r\n"), _tcslen(_T("\r\n"))))
+ if (!_tcsncmp(cur, _T("\r\n"), mir_tstrlen(_T("\r\n"))))
szEol = _T("\r\n");
if (*cur == '\n')
szEol = _T("\n");
if (szEol != NULL) {
- if (_tcslen(szReplacement) > _tcslen(szEol)) {
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(szReplacement) - _tcslen(szEol) + 1)*sizeof(TCHAR));
+ if (mir_tstrlen(szReplacement) > mir_tstrlen(szEol)) {
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szReplacement) - mir_tstrlen(szEol) + 1)*sizeof(TCHAR));
cur = res + pos;
}
- memmove(cur + _tcslen(szReplacement), cur + _tcslen(szEol), (_tcslen(cur + _tcslen(szEol)) + 1)*sizeof(TCHAR));
- memcpy(cur, szReplacement, _tcslen(szReplacement)*sizeof(TCHAR));
- pos += _tcslen(szReplacement) - 1;
+ memmove(cur + mir_tstrlen(szReplacement), cur + mir_tstrlen(szEol), (mir_tstrlen(cur + mir_tstrlen(szEol)) + 1)*sizeof(TCHAR));
+ memcpy(cur, szReplacement, mir_tstrlen(szReplacement)*sizeof(TCHAR));
+ pos += mir_tstrlen(szReplacement) - 1;
}
}
- return (TCHAR*)mir_realloc(res, (_tcslen(res) + 1)*sizeof(TCHAR));
+ return (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
}
static TCHAR *parseInsert(ARGUMENTSINFO *ai)
@@ -161,17 +161,17 @@ static TCHAR *parseInsert(ARGUMENTSINFO *ai)
return NULL;
unsigned int pos = ttoi(ai->targv[3]);
- if (pos > _tcslen(ai->targv[1]))
+ if (pos > mir_tstrlen(ai->targv[1]))
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((_tcslen(ai->targv[1]) + _tcslen(ai->targv[2]) + 1)*sizeof(TCHAR));
+ TCHAR *res = (TCHAR*)mir_alloc((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((_tcslen(ai->targv[1]) + _tcslen(ai->targv[2]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((mir_tstrlen(ai->targv[1]) + mir_tstrlen(ai->targv[2]) + 1) * sizeof(TCHAR)));
_tcsncpy(res, ai->targv[1], pos);
_tcscpy(res + pos, ai->targv[2]);
- _tcscpy(res + pos + _tcslen(ai->targv[2]), ai->targv[1] + pos);
+ _tcscpy(res + pos + mir_tstrlen(ai->targv[2]), ai->targv[1] + pos);
return res;
}
@@ -184,7 +184,7 @@ static TCHAR *parseLeft(ARGUMENTSINFO *ai)
if (len < 0)
return NULL;
- len = min(len, (signed int)_tcslen(ai->targv[1]));
+ len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
@@ -199,7 +199,7 @@ static TCHAR *parseLen(ARGUMENTSINFO *ai)
if (ai->argc != 2)
return NULL;
- return itot((int)_tcslen(ai->targv[1]));
+ return itot((int)mir_tstrlen(ai->targv[1]));
}
static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
@@ -209,7 +209,7 @@ static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
int count = 1;
TCHAR *cur = ai->targv[1];
- while (cur < (ai->targv[1] + _tcslen(ai->targv[1]))) {
+ while (cur < (ai->targv[1] + mir_tstrlen(ai->targv[1]))) {
if (!_tcsncmp(cur, _T("\r\n"), 2)) {
count++;
cur++;
@@ -242,7 +242,7 @@ static TCHAR *parseLongest(ARGUMENTSINFO *ai)
unsigned int iLong = 1;
for (unsigned int i = 2; i < ai->argc; i++)
- if (_tcslen(ai->targv[i]) > _tcslen(ai->targv[iLong]))
+ if (mir_tstrlen(ai->targv[i]) > mir_tstrlen(ai->targv[iLong]))
iLong = i;
return mir_tstrdup(ai->targv[iLong]);
@@ -269,12 +269,12 @@ static TCHAR *parsePad(ARGUMENTSINFO *ai)
if (padding < 0)
return NULL;
- unsigned int addcount = max(padding - (signed int)_tcslen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
+ TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
TCHAR *cur = res;
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -296,14 +296,14 @@ static TCHAR *parsePadright(ARGUMENTSINFO *ai)
if (padding < 0)
return NULL;
- unsigned int addcount = max(padding - (signed int)_tcslen(ai->targv[1]), 0);
- TCHAR *res = (TCHAR*)mir_alloc((addcount + _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ unsigned int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
+ TCHAR *res = (TCHAR*)mir_alloc((addcount + mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((addcount + _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((addcount + mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
_tcscpy(res, ai->targv[1]);
- TCHAR *cur = res + _tcslen(ai->targv[1]);
+ TCHAR *cur = res + mir_tstrlen(ai->targv[1]);
for (unsigned int i = 0; i < addcount; i++)
*cur++ = padchar;
@@ -323,7 +323,7 @@ static TCHAR *parsePadcut(ARGUMENTSINFO *ai)
if (padding < 0)
return NULL;
- int addcount = max(padding - (signed int)_tcslen(ai->targv[1]), 0);
+ int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
@@ -352,7 +352,7 @@ static TCHAR *parsePadcutright(ARGUMENTSINFO *ai)
if (padding < 0)
return NULL;
- int addcount = max(padding - (signed int)_tcslen(ai->targv[1]), 0);
+ int addcount = max(padding - (signed int)mir_tstrlen(ai->targv[1]), 0);
TCHAR *res = (TCHAR*)mir_alloc((padding + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
@@ -377,11 +377,11 @@ static TCHAR *parseRepeat(ARGUMENTSINFO *ai)
if (count < 0)
return NULL;
- TCHAR *res = (TCHAR*)mir_alloc((count * _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ TCHAR *res = (TCHAR*)mir_alloc((count * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((count * _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((count * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
for (int i = 0; i < count; i++)
_tcscat(res, ai->targv[1]);
@@ -398,22 +398,22 @@ static TCHAR *parseReplace(ARGUMENTSINFO *ai)
size_t pos = 0;
TCHAR *res = mir_tstrdup(ai->targv[1]);
for (size_t i = 2; i < ai->argc; i += 2) {
- if (_tcslen(ai->targv[i]) == 0)
+ if (mir_tstrlen(ai->targv[i]) == 0)
continue;
- for (pos = 0; pos<_tcslen(res); pos++) {
+ for (pos = 0; pos<mir_tstrlen(res); pos++) {
cur = res + pos;
- if (!_tcsncmp(cur, ai->targv[i], _tcslen(ai->targv[i]))) {
- if (_tcslen(ai->targv[i + 1]) > _tcslen(ai->targv[i])) {
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(ai->targv[i + 1]) - _tcslen(ai->targv[i]) + 1)*sizeof(TCHAR));
+ if (!_tcsncmp(cur, ai->targv[i], mir_tstrlen(ai->targv[i]))) {
+ if (mir_tstrlen(ai->targv[i + 1]) > mir_tstrlen(ai->targv[i])) {
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(ai->targv[i + 1]) - mir_tstrlen(ai->targv[i]) + 1)*sizeof(TCHAR));
cur = res + pos;
}
- memmove(cur + _tcslen(ai->targv[i + 1]), cur + _tcslen(ai->targv[i]), (_tcslen(cur + _tcslen(ai->targv[i])) + 1)*sizeof(TCHAR));
- memcpy(cur, ai->targv[i + 1], _tcslen(ai->targv[i + 1])*sizeof(TCHAR));
- pos += _tcslen(ai->targv[i + 1]) - 1;
+ memmove(cur + mir_tstrlen(ai->targv[i + 1]), cur + mir_tstrlen(ai->targv[i]), (mir_tstrlen(cur + mir_tstrlen(ai->targv[i])) + 1)*sizeof(TCHAR));
+ memcpy(cur, ai->targv[i + 1], mir_tstrlen(ai->targv[i + 1])*sizeof(TCHAR));
+ pos += mir_tstrlen(ai->targv[i + 1]) - 1;
}
}
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 1)*sizeof(TCHAR));
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
}
return res;
@@ -428,13 +428,13 @@ static TCHAR *parseRight(ARGUMENTSINFO *ai)
if (len < 0)
return NULL;
- len = min(len, (signed int)_tcslen(ai->targv[1]));
+ len = min(len, (signed int)mir_tstrlen(ai->targv[1]));
TCHAR *res = (TCHAR*)mir_alloc((len + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
memset(res, 0, ((len + 1)*sizeof(TCHAR)));
- _tcsncpy(res, ai->targv[1] + _tcslen(ai->targv[1]) - len, len);
+ _tcsncpy(res, ai->targv[1] + mir_tstrlen(ai->targv[1]) - len, len);
return res;
}
@@ -446,24 +446,24 @@ static TCHAR *parseScroll(ARGUMENTSINFO *ai)
if (ai->argc != 4)
return NULL;
- if (_tcslen(ai->targv[1]) == 0)
+ if (mir_tstrlen(ai->targv[1]) == 0)
return mir_tstrdup(ai->targv[1]);
- size_t move = ttoi(ai->targv[3]) % _tcslen(ai->targv[1]);
+ size_t move = ttoi(ai->targv[3]) % mir_tstrlen(ai->targv[1]);
size_t display = ttoi(ai->targv[2]);
- if (display > _tcslen(ai->targv[1]))
- display = (unsigned)_tcslen(ai->targv[1]);
+ if (display > mir_tstrlen(ai->targv[1]))
+ display = (unsigned)mir_tstrlen(ai->targv[1]);
- TCHAR *res = (TCHAR*)mir_alloc((2 * _tcslen(ai->targv[1]) + 1)*sizeof(TCHAR));
+ TCHAR *res = (TCHAR*)mir_alloc((2 * mir_tstrlen(ai->targv[1]) + 1)*sizeof(TCHAR));
if (res == NULL)
return NULL;
- memset(res, 0, ((2 * _tcslen(ai->targv[1]) + 1) * sizeof(TCHAR)));
+ memset(res, 0, ((2 * mir_tstrlen(ai->targv[1]) + 1) * sizeof(TCHAR)));
_tcscpy(res, ai->targv[1]);
_tcscat(res, ai->targv[1]);
- memmove(res, res + move, (_tcslen(res + move) + 1)*sizeof(TCHAR));
+ memmove(res, res + move, (mir_tstrlen(res + move) + 1)*sizeof(TCHAR));
*(res + display) = 0;
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + 1)*sizeof(TCHAR));
+ res = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + 1)*sizeof(TCHAR));
return res;
}
@@ -475,7 +475,7 @@ static TCHAR *parseShortest(ARGUMENTSINFO *ai)
int iShort = 1;
for (unsigned i = 2; i < ai->argc; i++)
- if (_tcslen(ai->targv[i]) < _tcslen(ai->targv[iShort]))
+ if (mir_tstrlen(ai->targv[i]) < mir_tstrlen(ai->targv[iShort]))
iShort = i;
return mir_tstrdup(ai->targv[iShort]);
@@ -594,9 +594,9 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai)
int to, from = max(ttoi(ai->targv[2]) - 1, 0);
if (ai->argc > 3)
- to = min(ttoi(ai->targv[3]), (int)_tcslen(ai->targv[1]));
+ to = min(ttoi(ai->targv[3]), (int)mir_tstrlen(ai->targv[1]));
else
- to = (int)_tcslen(ai->targv[1]);
+ to = (int)mir_tstrlen(ai->targv[1]);
if (to < from)
return NULL;
@@ -640,7 +640,7 @@ static TCHAR *parseTrim(ARGUMENTSINFO *ai)
while (*scur == ' ')
scur++;
- TCHAR *ecur = ai->targv[1] + _tcslen(ai->targv[1]) - 1;
+ TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]) - 1;
while ((*ecur == ' ') && (ecur > ai->targv[1]))
ecur--;
@@ -660,7 +660,7 @@ static TCHAR *parseTrim(ARGUMENTSINFO *ai)
static TCHAR *parseTab(ARGUMENTSINFO *ai)
{
int count = 1;
- if ((ai->argc == 2) && (_tcslen(ai->targv[1]) > 0))
+ if ((ai->argc == 2) && (mir_tstrlen(ai->targv[1]) > 0))
count = ttoi(ai->targv[1]);
if (count < 0)
@@ -701,7 +701,7 @@ static TCHAR *getNthWord(TCHAR *szString, int w)
scur++;
count++;
- while ((count < w) && (scur < szString + _tcslen(szString))) {
+ while ((count < w) && (scur < szString + mir_tstrlen(szString))) {
if (*scur == ' ') {
while (*scur == ' ')
scur++;
@@ -735,7 +735,7 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai)
TCHAR *res = NULL;
int to, from = ttoi(ai->targv[2]);
if (ai->argc == 4) {
- if (_tcslen(ai->targv[3]) > 0)
+ if (mir_tstrlen(ai->targv[3]) > 0)
to = ttoi(ai->targv[3]);
else
to = 100000; // rework
@@ -751,7 +751,7 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai)
return res;
if (res != NULL) {
- TCHAR *pres = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(szWord) + 2)*sizeof(TCHAR));
+ TCHAR *pres = (TCHAR*)mir_realloc(res, (mir_tstrlen(res) + mir_tstrlen(szWord) + 2)*sizeof(TCHAR));
if (pres != NULL) {
res = pres;
_tcscat(res, _T(" "));
diff --git a/plugins/Variables/src/parse_system.cpp b/plugins/Variables/src/parse_system.cpp
index 7551ecab15..35ba4e21df 100644
--- a/plugins/Variables/src/parse_system.cpp
+++ b/plugins/Variables/src/parse_system.cpp
@@ -51,10 +51,10 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
if (ai->argc != 2)
return NULL;
- if (_tcslen(ai->targv[1]) == 0)
+ if (mir_tstrlen(ai->targv[1]) == 0)
szCounter = mir_tstrdup(_T("\\Processor(_Total)\\% Processor Time"));
else {
- int size = (int)_tcslen(ai->targv[1]) + 32;
+ int size = (int)mir_tstrlen(ai->targv[1]) + 32;
szCounter = (TCHAR *)mir_alloc(size * sizeof(TCHAR));
if (szCounter == NULL)
return NULL;
@@ -116,7 +116,7 @@ static TCHAR *parseCpuLoad(ARGUMENTSINFO *ai)
static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai)
{
TCHAR *szFormat;
- if (ai->argc == 1 || (ai->argc > 1 && _tcslen(ai->targv[1]) == 0))
+ if (ai->argc == 1 || (ai->argc > 1 && mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
@@ -137,7 +137,7 @@ static TCHAR *parseCurrentDate(ARGUMENTSINFO *ai)
static TCHAR *parseCurrentTime(ARGUMENTSINFO *ai)
{
TCHAR *szFormat;
- if (ai->argc == 1 || (ai->argc > 1) && (_tcslen(ai->targv[1]) == 0))
+ if (ai->argc == 1 || (ai->argc > 1) && (mir_tstrlen(ai->targv[1]) == 0))
szFormat = NULL;
else
szFormat = ai->targv[1];
@@ -168,13 +168,13 @@ static TCHAR *parseDirectory(ARGUMENTSINFO *ai)
return mir_tstrdup(ai->targv[1]);
size_t bi, ei;
- for (ei = 0; ei < _tcslen(ai->targv[1]); ei++) {
+ for (ei = 0; ei < mir_tstrlen(ai->targv[1]); ei++) {
if (ai->targv[1][ei] == '\\')
depth--;
if (!depth)
break;
}
- if (ei >= _tcslen(ai->targv[1]))
+ if (ei >= mir_tstrlen(ai->targv[1]))
return ai->targv[1];
for (bi = ei - 1; bi > 0; bi--)
@@ -203,7 +203,7 @@ static TCHAR *parseDirectory2(ARGUMENTSINFO *ai)
if (depth <= 0)
return NULL;
- TCHAR *ecur = ai->targv[1] + _tcslen(ai->targv[1]);
+ TCHAR *ecur = ai->targv[1] + mir_tstrlen(ai->targv[1]);
while (depth > 0) {
while ((*ecur != '\\') && (ecur > ai->targv[1]))
ecur--;
@@ -226,17 +226,17 @@ static int getTime(TCHAR *szTime, struct tm *date)
{
// do some extra checks here
TCHAR *cur = szTime;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_mon = _tcstoul(cur, &cur, 10) - 1;
cur++;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_mday = _tcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_year = _tcstoul(cur, &cur, 10);
@@ -247,17 +247,17 @@ static int getTime(TCHAR *szTime, struct tm *date)
date->tm_year = date->tm_year < 38 ? date->tm_year + 100 : date->tm_year;
cur++;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_hour = _tcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_min = _tcstoul(cur, &cur, 10);
cur++;
- if (cur >= szTime + _tcslen(szTime))
+ if (cur >= szTime + mir_tstrlen(szTime))
return -1;
date->tm_sec = _tcstoul(cur, &cur, 10);
@@ -386,11 +386,11 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai)
if (*ai->targv[4] == 'd')
bFiles = FALSE;
}
- if (tszFirst[_tcslen(tszFirst) - 1] == '\\')
- _tcsncat(tszFirst, tszFilter, SIZEOF(tszFirst) - _tcslen(tszFirst) - 1);
+ if (tszFirst[mir_tstrlen(tszFirst) - 1] == '\\')
+ _tcsncat(tszFirst, tszFilter, SIZEOF(tszFirst) - mir_tstrlen(tszFirst) - 1);
else {
- _tcsncat(tszFirst, _T("\\"), SIZEOF(tszFirst) - _tcslen(tszFirst) - 1);
- _tcsncat(tszFirst, tszFilter, SIZEOF(tszFirst) - _tcslen(tszFirst) - 1);
+ _tcsncat(tszFirst, _T("\\"), SIZEOF(tszFirst) - mir_tstrlen(tszFirst) - 1);
+ _tcsncat(tszFirst, tszFilter, SIZEOF(tszFirst) - mir_tstrlen(tszFirst) - 1);
}
WIN32_FIND_DATA ffd;
@@ -399,17 +399,17 @@ static TCHAR *parseListDir(ARGUMENTSINFO *ai)
return NULL;
}
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
- tszRes = (TCHAR*)mir_alloc((_tcslen(ffd.cFileName) + _tcslen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
_tcscpy(tszRes, ffd.cFileName);
}
while (FindNextFile(hFind, &ffd) != 0) {
if (((ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY) && (bDirs)) || ((!(ffd.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)) && (bFiles))) {
if (tszRes != NULL) {
_tcscat(tszRes, tszSeperator);
- tszRes = (TCHAR*)mir_realloc(tszRes, (_tcslen(tszRes) + _tcslen(ffd.cFileName) + _tcslen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (TCHAR*)mir_realloc(tszRes, (mir_tstrlen(tszRes) + mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
}
else {
- tszRes = (TCHAR*)mir_alloc((_tcslen(ffd.cFileName) + _tcslen(tszSeperator) + 1)*sizeof(TCHAR));
+ tszRes = (TCHAR*)mir_alloc((mir_tstrlen(ffd.cFileName) + mir_tstrlen(tszSeperator) + 1)*sizeof(TCHAR));
_tcscpy(tszRes, _T(""));
}
_tcscat(tszRes, ffd.cFileName);
@@ -530,7 +530,7 @@ static TCHAR *parseTimestamp2Date(ARGUMENTSINFO *ai)
if (timestamp == 0)
return NULL;
- if ((ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0)))
+ if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -562,7 +562,7 @@ static TCHAR *parseTimestamp2Time(ARGUMENTSINFO *ai)
return NULL;
TCHAR *szFormat;
- if ((ai->argc == 2) || ((ai->argc > 2) && (_tcslen(ai->targv[2]) == 0)))
+ if ((ai->argc == 2) || ((ai->argc > 2) && (mir_tstrlen(ai->targv[2]) == 0)))
szFormat = NULL;
else
szFormat = ai->targv[2];
@@ -859,7 +859,7 @@ static TCHAR *parseClipboard(ARGUMENTSINFO *ai)
HANDLE hData = GetClipboardData(CF_UNICODETEXT);
if (hData != NULL) {
TCHAR *tszText = (TCHAR*)GlobalLock(hData);
- size_t len = _tcslen(tszText);
+ size_t len = mir_tstrlen(tszText);
res = (TCHAR*)mir_alloc((len + 1) * sizeof(TCHAR));
_tcscpy(res, tszText);
res[len] = 0;
diff --git a/plugins/Variables/src/parse_variables.cpp b/plugins/Variables/src/parse_variables.cpp
index 8a711a1524..ea5a833786 100644
--- a/plugins/Variables/src/parse_variables.cpp
+++ b/plugins/Variables/src/parse_variables.cpp
@@ -26,7 +26,7 @@ static int vrCount = 0;
static int addToVariablesRegister(TCHAR *szName, TCHAR *szText)
{
- if ((szName == NULL) || (szText == NULL) || (_tcslen(szName) <= 0))
+ if ((szName == NULL) || (szText == NULL) || (mir_tstrlen(szName) <= 0))
return -1;
mir_cslock lck(csVarRegister);
@@ -50,7 +50,7 @@ static int addToVariablesRegister(TCHAR *szName, TCHAR *szText)
static TCHAR *searchVariableRegister(TCHAR *szName)
{
- if ((szName == NULL) || (_tcslen(szName) <= 0))
+ if ((szName == NULL) || (mir_tstrlen(szName) <= 0))
return NULL;
mir_cslock lck(csVarRegister);
diff --git a/plugins/Variables/src/tokenregister.cpp b/plugins/Variables/src/tokenregister.cpp
index a4722f82d2..6bfb84ad4a 100644
--- a/plugins/Variables/src/tokenregister.cpp
+++ b/plugins/Variables/src/tokenregister.cpp
@@ -41,7 +41,7 @@ unsigned long int hashlittle(void *key, size_t length, unsigned long int initval
static DWORD NameHashFunction(TCHAR *tszStr)
{
- return (DWORD)hashlittle(tszStr, _tcslen(tszStr)*sizeof(TCHAR), 0);
+ return (DWORD)hashlittle(tszStr, mir_tstrlen(tszStr)*sizeof(TCHAR), 0);
}
static TokenRegisterEntry* FindTokenRegisterByName(TCHAR *name)
diff --git a/plugins/Variables/src/variables.cpp b/plugins/Variables/src/variables.cpp
index fc92c323bc..3c5652f6f1 100644
--- a/plugins/Variables/src/variables.cpp
+++ b/plugins/Variables/src/variables.cpp
@@ -161,7 +161,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
pargv = argv = NULL;
//fi->pCount = 0;
memcpy(&afi, fi, sizeof(afi));
- for (pos = 0; pos < _tcslen(string); pos++) {
+ for (pos = 0; pos < mir_tstrlen(string); pos++) {
// string may move in memory, iterate by remembering the position in the string
cur = string+pos;
// mir_free memory from last iteration, this way we can bail out at any time in the loop
@@ -175,46 +175,46 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
pargv = argv = NULL;
// new round
if (*cur == DONTPARSE_CHAR) {
- memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR));
+ memmove(cur, cur+1, (mir_tstrlen(cur+1)+1)*sizeof(TCHAR));
if (*cur == DONTPARSE_CHAR)
continue;
while ( (*cur != DONTPARSE_CHAR) && (*cur != 0))
cur++;
- memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR));
+ memmove(cur, cur+1, (mir_tstrlen(cur+1)+1)*sizeof(TCHAR));
pos = cur-string-1;
continue;
}
// remove end of lines
else if ((!_tcsncmp(cur, _T("\r\n"), 2)) && (gParseOpts.bStripEOL)) {
- memmove(cur, cur+2, (_tcslen(cur+2)+1)*sizeof(TCHAR));
+ memmove(cur, cur+2, (mir_tstrlen(cur+2)+1)*sizeof(TCHAR));
pos = cur-string-1;
continue;
}
else if ((*cur == '\n' && gParseOpts.bStripEOL) || (*cur == ' ' && gParseOpts.bStripWS)) {
- memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR));
+ memmove(cur, cur+1, (mir_tstrlen(cur+1)+1)*sizeof(TCHAR));
pos = cur - string - 1;
continue;
}
// remove comments
- else if (!_tcsncmp(cur, _T(COMMENT_STRING), _tcslen(_T(COMMENT_STRING)))) {
+ else if (!_tcsncmp(cur, _T(COMMENT_STRING), mir_tstrlen(_T(COMMENT_STRING)))) {
scur = cur;
while ( _tcsncmp(cur, _T("\r\n"), 2) && *cur != '\n' && *cur != 0)
cur++;
if (*cur == 0) {
*scur = 0;
- string = (TCHAR*)mir_realloc(string, (_tcslen(string)+1)*sizeof(TCHAR));
+ string = (TCHAR*)mir_realloc(string, (mir_tstrlen(string)+1)*sizeof(TCHAR));
continue;
}
- memmove(scur, cur, (_tcslen(cur)+1)*sizeof(TCHAR));
+ memmove(scur, cur, (mir_tstrlen(cur)+1)*sizeof(TCHAR));
pos = scur-string-1;
continue;
}
else if ((*cur != FIELD_CHAR) && (*cur != FUNC_CHAR) && (*cur != FUNC_ONCE_CHAR)) {
if (gParseOpts.bStripAll) {
- memmove(cur, cur+1, (_tcslen(cur+1)+1)*sizeof(TCHAR));
+ memmove(cur, cur+1, (mir_tstrlen(cur+1)+1)*sizeof(TCHAR));
pos = cur - string - 1;
}
continue;
@@ -255,7 +255,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
}
scur = cur; // store this pointer for later use
if (*cur == FIELD_CHAR) {
- size_t len = _tcslen(tr != NULL ? tr->tszTokenString : fi->tszaTemporaryVars[tmpVarPos]);
+ size_t len = mir_tstrlen(tr != NULL ? tr->tszTokenString : fi->tszaTemporaryVars[tmpVarPos]);
cur++;
if (*(cur + len) != FIELD_CHAR) { // the next char after the token should be %
fi->eCount++;
@@ -266,7 +266,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
else if ((*cur == FUNC_CHAR) || (*cur == FUNC_ONCE_CHAR)) {
TCHAR *argcur;
- cur += _tcslen(tr->tszTokenString)+1;
+ cur += mir_tstrlen(tr->tszTokenString)+1;
argcur = getArguments(cur, &argv, &argc);
if ((argcur == cur) || (argcur == NULL)) {
fi->eCount++;
@@ -339,8 +339,8 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
}
}*/
- size_t parsedTokenLen = _tcslen(parsedToken);
- size_t initStrLen = _tcslen(string);
+ size_t parsedTokenLen = mir_tstrlen(parsedToken);
+ size_t initStrLen = mir_tstrlen(string);
size_t tokenLen = cur-scur;
scurPos = scur-string;
curPos = cur-string;
@@ -354,10 +354,10 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
}
scur = string+scurPos;
cur = string+curPos;
- memmove(scur + parsedTokenLen, cur, (_tcslen(cur)+1)*sizeof(TCHAR));
+ memmove(scur + parsedTokenLen, cur, (mir_tstrlen(cur)+1)*sizeof(TCHAR));
memcpy(scur, parsedToken, parsedTokenLen*sizeof(TCHAR));
{
- size_t len = _tcslen(string);
+ size_t len = mir_tstrlen(string);
string = (TCHAR*)mir_realloc(string, (len+1)*sizeof(TCHAR));
}
if (( ai.flags & AIF_DONTPARSE ) || tmpVarPos >= 0)
@@ -375,7 +375,7 @@ static TCHAR* replaceDynVars(TCHAR* szTemplate, FORMATINFO* fi)
mir_free(argv[i]);
mir_free(argv);
- return (TCHAR*)mir_realloc(string, (_tcslen(string)+1)*sizeof(TCHAR));
+ return (TCHAR*)mir_realloc(string, (mir_tstrlen(string)+1)*sizeof(TCHAR));
}
/*
diff --git a/plugins/Weather/src/weather_contacts.cpp b/plugins/Weather/src/weather_contacts.cpp
index 17d2c70e31..1949517426 100644
--- a/plugins/Weather/src/weather_contacts.cpp
+++ b/plugins/Weather/src/weather_contacts.cpp
@@ -295,14 +295,14 @@ INT_PTR CALLBACK DlgProcChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPa
// set filters
_tcsncpy(filter, TranslateT("Text Files"), SIZEOF(filter) - 1);
_tcsncat(filter, _T(" (*.txt)"), SIZEOF(filter) - mir_tstrlen(filter));
- pfilter = filter + _tcslen(filter)+1;
+ pfilter = filter + mir_tstrlen(filter)+1;
_tcsncpy(pfilter, _T("*.txt"), SIZEOF(filter) - 1);
- pfilter = pfilter + _tcslen(pfilter)+1;
+ pfilter = pfilter + mir_tstrlen(pfilter)+1;
_tcsncpy(pfilter, TranslateT("All Files"), SIZEOF(filter) - 1);
_tcsncat(pfilter, _T(" (*.*)"), SIZEOF(filter) - mir_tstrlen(filter));
- pfilter = pfilter + _tcslen(pfilter)+1;
+ pfilter = pfilter + mir_tstrlen(pfilter)+1;
_tcsncpy(pfilter, _T("*.*"), SIZEOF(filter) - 1);
- pfilter = pfilter + _tcslen(pfilter)+1;
+ pfilter = pfilter + mir_tstrlen(pfilter)+1;
*pfilter = '\0';
ofn.lpstrFilter = filter;
ofn.nFilterIndex = 1;
diff --git a/plugins/Weather/src/weather_conv.cpp b/plugins/Weather/src/weather_conv.cpp
index c3e1774746..15288b052a 100644
--- a/plugins/Weather/src/weather_conv.cpp
+++ b/plugins/Weather/src/weather_conv.cpp
@@ -84,7 +84,7 @@ void GetTemp(TCHAR *tempchar, TCHAR *unit, TCHAR* str)
TrimString(tempchar);
if (tempchar[0] == '-' && tempchar[1] == ' ')
- memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(_tcslen(&tempchar[2])+1));
+ memmove(&tempchar[1], &tempchar[2], sizeof(TCHAR)*(mir_tstrlen(&tempchar[2])+1));
// quit if the value obtained is N/A or not a number
if ( !_tcscmp(tempchar, NODATA) || !_tcscmp(tempchar, _T("N/A"))) {
@@ -395,7 +395,7 @@ WORD GetIcon(const TCHAR* cond, WIDATA *Data)
// using the format _T("# Weather <condition name> <counter> #"
mir_sntprintf(LangPackStr, SIZEOF(LangPackStr), _T("# Weather %s %i #"), statusStr[i], j);
_tcsncpy_s(LangPackStr1, TranslateTS(LangPackStr), _TRUNCATE);
- CharLowerBuff(LangPackStr1, (DWORD)_tcslen(LangPackStr1));
+ CharLowerBuff(LangPackStr1, (DWORD)mir_tstrlen(LangPackStr1));
if (_tcsstr(cond, LangPackStr1) != NULL)
return statusValue[i];
// loop until the translation string exists (ie, the translated string is differ from original)
@@ -414,7 +414,7 @@ void CaseConv(TCHAR *str)
TCHAR *pstr;
BOOL nextUp = TRUE;
- CharLowerBuff(str, (DWORD)_tcslen(str));
+ CharLowerBuff(str, (DWORD)mir_tstrlen(str));
for(pstr = str; *pstr; pstr++) {
if (*pstr == ' ' || *pstr == '-')
nextUp = TRUE;
@@ -499,7 +499,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str)
str[0] = 0;
// looking character by character
- for (i=0; i < _tcslen(dis); i++) {
+ for (i=0; i < mir_tstrlen(dis); i++) {
// for the escape characters
if (dis[i] == '\\') {
i++;
@@ -547,7 +547,7 @@ TCHAR* GetDisplay(WEATHERINFO *w, const TCHAR *dis, TCHAR* str)
i++;
name[0] = 0;
// read the entire variable name
- while (dis[i] != ']' && i < _tcslen(dis)) {
+ while (dis[i] != ']' && i < mir_tstrlen(dis)) {
mir_snprintf(temp, SIZEOF(temp), "%c", dis[i++]);
strcat(name, temp);
}
diff --git a/plugins/Weather/src/weather_data.cpp b/plugins/Weather/src/weather_data.cpp
index e49019e489..deb04358ec 100644
--- a/plugins/Weather/src/weather_data.cpp
+++ b/plugins/Weather/src/weather_data.cpp
@@ -252,7 +252,7 @@ void ConvertDataValue(WIDATAITEM *UpdateData, TCHAR *Data)
}
// truncating strings for day/month to 2 or 3 characters
else if ( !_tcsicmp(UpdateData->Unit, _T("DAY")) || !_tcsicmp(UpdateData->Unit, _T("MONTH")))
- if (opt.dUnit > 1 && _tcslen(Data) > opt.dUnit)
+ if (opt.dUnit > 1 && mir_tstrlen(Data) > opt.dUnit)
Data[opt.dUnit] = '\0';
}
}
@@ -280,7 +280,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
start = _tcsstr(szInfo, UpdateData->Start);
if (start != NULL) {
// set the starting location for getting data
- start += _tcslen(UpdateData->Start);
+ start += mir_tstrlen(UpdateData->Start);
szInfo = start;
}
}
@@ -295,7 +295,7 @@ void GetDataValue(WIDATAITEM *UpdateData, TCHAR *Data, TCHAR** szData)
// set the ending location
startloc = 0;
endloc = end - szInfo;
- end += _tcslen(UpdateData->End);
+ end += mir_tstrlen(UpdateData->End);
last = '\n';
}
diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp
index 4fcb96d091..7c69dc38f4 100644
--- a/plugins/Weather/src/weather_ini.cpp
+++ b/plugins/Weather/src/weather_ini.cpp
@@ -131,7 +131,7 @@ void WICondListAdd(char *str, WICONDLIST *List)
{
WICONDITEM *newItem = (WICONDITEM*)mir_alloc(sizeof(WICONDITEM));
wSetData(&newItem->Item, str);
- CharLowerBuff(newItem->Item, (DWORD)_tcslen( newItem->Item ));
+ CharLowerBuff(newItem->Item, (DWORD)mir_tstrlen( newItem->Item ));
newItem->Next = NULL;
if (List->Tail == NULL) List->Head = newItem;
else List->Tail->Next = newItem;
@@ -327,7 +327,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
// initialize the linked list for update items
Data->UpdateDataCount = 0;
- Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (_tcslen(pszShortFile) + _tcslen(pszFile) + 20)*sizeof( TCHAR );
+ Data->MemUsed = sizeof(WIDATA) + sizeof(WIDATALIST) + (mir_tstrlen(pszShortFile) + mir_tstrlen(pszFile) + 20)*sizeof( TCHAR );
Data->UpdateData = NULL;
Data->UpdateDataTail = NULL;
@@ -453,7 +453,7 @@ void LoadStationData(TCHAR *pszFile, TCHAR *pszShortFile, WIDATA *Data)
else if ( !_stricmp(ValName, "HIDDEN")) {
if ( !_stricmp(Value, "TRUE")) {
TCHAR *nm = Data->UpdateDataTail->Item.Name;
- size_t len = _tcslen(nm) + 1;
+ size_t len = mir_tstrlen(nm) + 1;
Data->UpdateDataTail->Item.Name = nm = ( TCHAR* )mir_realloc(nm, sizeof(TCHAR)*(len + 3));
memmove(nm + 1, nm, len*sizeof( TCHAR ));
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp
index c16649a62a..8e74b14a38 100644
--- a/plugins/Weather/src/weather_update.cpp
+++ b/plugins/Weather/src/weather_update.cpp
@@ -487,14 +487,14 @@ int GetWeatherData(MCONTACT hContact)
case '[': // variable, add the value to the result string
hasvar = TRUE;
if ( !DBGetData(hContact, _T2A(str2), &dbv)) {
- _tcsncat(DataValue, dbv.ptszVal, SIZEOF(DataValue) - _tcslen(DataValue));
+ _tcsncat(DataValue, dbv.ptszVal, SIZEOF(DataValue) - mir_tstrlen(DataValue));
DataValue[SIZEOF(DataValue)-1] = 0;
db_free(&dbv);
}
break;
case'\"': // constant, add it to the result string
- _tcsncat(DataValue, TranslateTS(str2), SIZEOF(DataValue) - _tcslen(DataValue));
+ _tcsncat(DataValue, TranslateTS(str2), SIZEOF(DataValue) - mir_tstrlen(DataValue));
DataValue[SIZEOF(DataValue)-1] = 0;
break;
}
@@ -527,7 +527,7 @@ int GetWeatherData(MCONTACT hContact)
break; // exit if break string is not found
}
*end = '\0';
- end += _tcslen(Item->Item.Break);
+ end += mir_tstrlen(Item->Item.Break);
while (end[0] == ' ')
end++; // remove extra space
@@ -557,7 +557,7 @@ int GetWeatherData(MCONTACT hContact)
if (cbuf[0] == '#')
cbuf = TranslateTS(DataValue);
db_set_ts(hContact, WEATHERCONDITION, _T2A(Item->Item.Name), cbuf);
- CharLowerBuff(DataValue, (DWORD)_tcslen(DataValue));
+ CharLowerBuff(DataValue, (DWORD)mir_tstrlen(DataValue));
cond = GetIcon(DataValue, Data);
}
else if ( _tcsicmp(Item->Item.Unit, _T("Cond")) == 0) {
diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp
index 92679003b7..feffb27c1f 100644
--- a/plugins/WebView/src/webview_alerts.cpp
+++ b/plugins/WebView/src/webview_alerts.cpp
@@ -125,9 +125,9 @@ int PopupAlert(WPARAM wParam, LPARAM lParam)
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE));
TCHAR *displaytext = (TCHAR*)lParam;
- if ((_tcslen(displaytext) == MAX_SECONDLINE) || (_tcslen(displaytext) > MAX_SECONDLINE))
+ if ((mir_tstrlen(displaytext) == MAX_SECONDLINE) || (mir_tstrlen(displaytext) > MAX_SECONDLINE))
mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), displaytext);
- else if (_tcslen(displaytext) < MAX_SECONDLINE)
+ else if (mir_tstrlen(displaytext) < MAX_SECONDLINE)
mir_sntprintf(ppd.lptzText, SIZEOF(ppd.lptzText), displaytext);
if ( db_get_b(NULL, MODULENAME, POP_USECUSTCLRS_KEY, 0)) {
diff --git a/plugins/WhenWasIt/src/dlg_handlers.cpp b/plugins/WhenWasIt/src/dlg_handlers.cpp
index 1f9ae0e06f..04716317e4 100644
--- a/plugins/WhenWasIt/src/dlg_handlers.cpp
+++ b/plugins/WhenWasIt/src/dlg_handlers.cpp
@@ -124,7 +124,7 @@ SIZE GetControlTextSize(HWND hCtrl)
TCHAR buffer[maxSize];
SIZE size;
GetWindowText(hCtrl, buffer, SIZEOF(buffer));
- GetTextExtentPoint32(hDC, buffer, (int)_tcslen(buffer), &size);
+ GetTextExtentPoint32(hDC, buffer, (int)mir_tstrlen(buffer), &size);
SelectObject(hDC, oldFont);
ReleaseDC(hCtrl, hDC);
return size;
@@ -144,7 +144,7 @@ int EnlargeControl(HWND hCtrl, HWND hGroup, SIZE oldSize)
TCHAR *strtrim(TCHAR *str)
{
size_t i = 0;
- size_t len = _tcslen(str);
+ size_t len = mir_tstrlen(str);
while ((i < len) && (str[i] == _T(' '))) { i++; }
if (i) {
memmove(str, str + i, len - i + 1);
diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp
index b67dcfb15a..7e3a5ba68a 100644
--- a/plugins/XSoundNotify/src/options.cpp
+++ b/plugins/XSoundNotify/src/options.cpp
@@ -78,7 +78,7 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
}
TCHAR *nick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR);
- size_t value_max_len = (_tcslen(uid) + _tcslen(nick) + 4);
+ size_t value_max_len = (mir_tstrlen(uid) + mir_tstrlen(nick) + 4);
TCHAR *value = (TCHAR *)mir_alloc(sizeof(TCHAR) * value_max_len);
mir_sntprintf(value, value_max_len, _T("%s (%s)"), nick, uid);
SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_SETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_OPT_COMBO_USERS, CB_ADDSTRING, 0, (LPARAM)value), hContact);
diff --git a/plugins/YAMN/src/browser/mailbrowser.cpp b/plugins/YAMN/src/browser/mailbrowser.cpp
index b1b1df711b..e15d71731d 100644
--- a/plugins/YAMN/src/browser/mailbrowser.cpp
+++ b/plugins/YAMN/src/browser/mailbrowser.cpp
@@ -1618,9 +1618,9 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, SIZEOF(headname));
ListView_GetItemText(hList, courRow, 1, headvalue, SIZEOF(headvalue));
- size_t headnamelen = _tcslen(headname);
+ size_t headnamelen = mir_tstrlen(headname);
if (headnamelen) sizeNeeded += 1 + headnamelen;
- sizeNeeded += 3 + _tcslen(headvalue);
+ sizeNeeded += 3 + mir_tstrlen(headvalue);
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
@@ -1631,7 +1631,7 @@ INT_PTR CALLBACK DlgProcYAMNShowMessage(HWND hDlg, UINT msg, WPARAM wParam, LPAR
if ((nReturnCmd == 1) && (ListView_GetItemState(hList, courRow, LVIS_SELECTED) == 0)) continue;
ListView_GetItemText(hList, courRow, 0, headname, SIZEOF(headname));
ListView_GetItemText(hList, courRow, 1, headvalue, SIZEOF(headvalue));
- if (_tcslen(headname)) courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("%s:\t%s\r\n"), headname, headvalue);
+ if (mir_tstrlen(headname)) courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("%s:\t%s\r\n"), headname, headvalue);
else courPos += mir_sntprintf(&buff[courPos], sizeNeeded + 1, _T("\t%s\r\n"), headvalue);
}
GlobalUnlock(hData);
@@ -2405,7 +2405,7 @@ INT_PTR CALLBACK DlgProcYAMNMailBrowser(HWND hDlg, UINT msg, WPARAM wParam, LPAR
ListView_GetItemText(hList, courRow, 1, subject, SIZEOF(subject));
ListView_GetItemText(hList, courRow, 2, size, SIZEOF(size));
ListView_GetItemText(hList, courRow, 3, date, SIZEOF(date));
- sizeNeeded += 5 + _tcslen(from) + _tcslen(subject) + _tcslen(size) + _tcslen(date);
+ sizeNeeded += 5 + mir_tstrlen(from) + mir_tstrlen(subject) + mir_tstrlen(size) + mir_tstrlen(date);
}
if (sizeNeeded && OpenClipboard(hDlg)) {
EmptyClipboard();
diff --git a/plugins/YAPP/src/popwin.cpp b/plugins/YAPP/src/popwin.cpp
index b7e25d2a3a..c29cbeed70 100644
--- a/plugins/YAPP/src/popwin.cpp
+++ b/plugins/YAPP/src/popwin.cpp
@@ -584,7 +584,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
if (options.time_layout != PT_NONE) {
SIZE size_t;
if (hFontTime) SelectObject(hdc, (HGDIOBJ)hFontTime);
- GetTextExtentPoint32(hdc, pwd->tbuff, (int)_tcslen(pwd->tbuff), &size_t);
+ GetTextExtentPoint32(hdc, pwd->tbuff, (int)mir_tstrlen(pwd->tbuff), &size_t);
pwd->time_height = size_t.cy;
pwd->time_width = size_t.cx;
}
@@ -592,7 +592,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
// titlebar height
if (hFontFirstLine) SelectObject(hdc, (HGDIOBJ)hFontFirstLine);
TCHAR *title = mir_u2t(pd->pwzTitle);
- GetTextExtentPoint32(hdc, title, (int)_tcslen(title), &size);
+ GetTextExtentPoint32(hdc, title, (int)mir_tstrlen(title), &size);
mir_free(title);
pwd->tb_height = size.cy;
if (options.time_layout == PT_LEFT || options.time_layout == PT_RIGHT) {
diff --git a/plugins/YAPP/src/yapp_history_dlg.cpp b/plugins/YAPP/src/yapp_history_dlg.cpp
index 04d9eae3a3..1a3d083519 100644
--- a/plugins/YAPP/src/yapp_history_dlg.cpp
+++ b/plugins/YAPP/src/yapp_history_dlg.cpp
@@ -120,7 +120,7 @@ static int lastColumn = -1; //last sort column
int MatchesFilterCS(const TCHAR *filter, const PopupHistoryData *popupItem) //case sensitive
{
- if (_tcslen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
+ if (mir_tstrlen(filter) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
match = (_tcsstr(popupItem->messageT, filter)) ? 1 : match; //check message part
@@ -149,7 +149,7 @@ __inline void ConvertCase(TCHAR *dest, const TCHAR *source, size_t size)
int MatchesFilterCI(const TCHAR *filterS, const PopupHistoryData *popupItem)
{
- if (_tcslen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
+ if (mir_tstrlen(filterS) <= 0) { return 1; } //if no filter is set then the popup item matches the filter
int match = 0;
const int BUFFER_SIZE = 1024;
TCHAR buffer[BUFFER_SIZE];
@@ -489,7 +489,7 @@ void CopyPopupDataToClipboard(HWND hList, int selection)
if (found)
{
EmptyClipboard();
- int len = (int)_tcslen(buffer);
+ int len = (int)mir_tstrlen(buffer);
HANDLE hData = GlobalAlloc(GMEM_MOVEABLE, (len + 2) * sizeof(TCHAR));
clipboard = (TCHAR *) GlobalLock(hData);