diff options
Diffstat (limited to 'plugins/TabSRMM/src')
31 files changed, 212 insertions, 212 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp index 58fe1c4301..5538eb690f 100644 --- a/plugins/TabSRMM/src/TSButton.cpp +++ b/plugins/TabSRMM/src/TSButton.cpp @@ -292,7 +292,7 @@ nonflat_themed: }
SIZE sz;
- GetTextExtentPoint32(hdcMem, szText, lstrlen(szText), &sz);
+ GetTextExtentPoint32(hdcMem, szText, mir_tstrlen(szText), &sz);
if (ctl->cHot) {
SIZE szHot;
GetTextExtentPoint32A(hdcMem, "&", 1, &szHot);
@@ -301,7 +301,7 @@ nonflat_themed: if (ctl->arrow)
DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - PluginConfig.m_smcxicon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - PluginConfig.m_smcyicon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
SelectObject(hdcMem, ctl->hFont);
- DrawState(hdcMem, NULL, NULL, (LPARAM)szText, lstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, NULL, NULL, (LPARAM)szText, mir_tstrlen(szText), (rcText.right - rcText.left - sz.cx) / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - sz.cy) / 2 : (rcText.bottom - rcText.top - sz.cy) / 2 - (ctl->stateId == PBS_PRESSED ? 0 : 1), sz.cx, sz.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
SelectObject(hdcMem, hOldFont);
}
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 37987d4278..cdc0a8af53 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -144,7 +144,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** }
if ( szTemp[0] ) {
- size_t iLen = lstrlen(szTemp);
+ size_t iLen = mir_tstrlen(szTemp);
memcpy( d, szTemp, iLen * sizeof(TCHAR));
d += iLen;
}
@@ -432,9 +432,9 @@ static TCHAR * _tcsrplc(TCHAR **src, const TCHAR *ptrn, const TCHAR *rplc) size_t lSrc, lPtrn, lRplc;
TCHAR *tszFound, *tszTail;
- lSrc = lstrlen(*src);
- lPtrn = lstrlen(ptrn);
- lRplc = lstrlen(rplc);
+ lSrc = mir_tstrlen(*src);
+ lPtrn = mir_tstrlen(ptrn);
+ lRplc = mir_tstrlen(rplc);
if (lPtrn && lSrc && lSrc >= lPtrn && (tszFound = _tcsstr(*src, ptrn)) != NULL) {
if (lRplc > lPtrn)
*src = (TCHAR*) mir_realloc((void*) * src,
@@ -463,9 +463,9 @@ static TCHAR * _tcsnrplc(TCHAR *src, size_t n, const TCHAR *ptrn, const TCHAR *r size_t lSrc, lPtrn, lRplc;
TCHAR *tszFound, *tszTail;
- lSrc = lstrlen(src);
- lPtrn = lstrlen(ptrn);
- lRplc = lstrlen(rplc);
+ lSrc = mir_tstrlen(src);
+ lPtrn = mir_tstrlen(ptrn);
+ lRplc = mir_tstrlen(rplc);
if (lPtrn && lSrc && lSrc >= lPtrn && /* lengths are ok */
(tszFound = _tcsstr(src, ptrn)) != NULL && /* pattern was found in string */
(n < 0 || lSrc - lPtrn + lRplc < n) && /* there is enough room in the string */
@@ -591,7 +591,7 @@ static int Log_AppendRTF(LOGSTREAMDATA* streamData, BOOL simpleMode, char **buff }
if (szTemp[0]) {
- int iLen = lstrlenA(szTemp);
+ int iLen = mir_strlen(szTemp);
memcpy(d, szTemp, iLen);
d += iLen;
}
@@ -623,11 +623,11 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced, return;
if (streamData->lin->ptszNick) {
- if (g_Settings.bLogLimitNames && lstrlen(streamData->lin->ptszNick) > 20) {
- lstrcpyn(szTemp, streamData->lin->ptszNick, 20);
- lstrcpyn(szTemp + 20, _T("..."), 4);
+ if (g_Settings.bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ mir_tstrncpy(szTemp, streamData->lin->ptszNick, 20);
+ mir_tstrncpy(szTemp + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp, streamData->lin->ptszNick, 511);
+ else mir_tstrncpy(szTemp, streamData->lin->ptszNick, 511);
if (g_Settings.bClickableNicks)
mir_sntprintf(szTemp2, SIZEOF(szTemp2), _T("~~++#%s#++~~"), szTemp);
@@ -883,8 +883,8 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (g_Settings.bShowTime) {
TCHAR szTimeStamp[30], szOldTimeStamp[30];
- lstrcpyn(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), 30);
- lstrcpyn(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), 30);
+ mir_tstrncpy(szTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, lin->time), 30);
+ mir_tstrncpy(szOldTimeStamp, pci->MakeTimeStamp(g_Settings.pszTimeStamp, streamData->si->LastTime), 30);
if (!g_Settings.bShowTimeIfChanged || streamData->si->LastTime == 0 || lstrcmp(szTimeStamp, szOldTimeStamp)) {
streamData->si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, &buffer, &bufferEnd, &bufferAlloced, _T("%s"), szTimeStamp);
@@ -906,7 +906,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData) if (g_Settings.bLogClassicIndicators)
Log_Append(&buffer, &bufferEnd, &bufferAlloced, "%s", pszIndicator);
- lstrcpyn(pszTemp, lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick, 299);
+ mir_tstrncpy(pszTemp, lin->bIsMe ? g_Settings.pszOutgoingNick : g_Settings.pszIncomingNick, 299);
p1 = _tcsstr(pszTemp, _T("%n"));
if (p1)
p1[1] = 's';
@@ -950,7 +950,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = lstrlenA(lstrdat->buffer);
+ lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp index 605341583d..4c45d5bb11 100644 --- a/plugins/TabSRMM/src/chat/message.cpp +++ b/plugins/TabSRMM/src/chat/message.cpp @@ -107,7 +107,7 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si) }
else p1 += 7;
- MoveMemory(pszText, p1, lstrlenA(p1) + 1);
+ MoveMemory(pszText, p1, mir_strlen(p1) + 1);
p1 = pszText;
// iterate through all characters, if rtf control character found then take action
@@ -295,9 +295,9 @@ TCHAR* Chat_DoRtfToTags(char* pszText, SESSION_INFO *si) // move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
- MoveMemory(p1 + lstrlenA(InsertThis) , p1 + iRemoveChars, lstrlenA(p1) - iRemoveChars + 1);
- CopyMemory(p1, InsertThis, lstrlenA(InsertThis));
- p1 += lstrlenA(InsertThis);
+ MoveMemory(p1 + mir_strlen(InsertThis) , p1 + iRemoveChars, mir_strlen(p1) - iRemoveChars + 1);
+ CopyMemory(p1, InsertThis, mir_strlen(InsertThis));
+ p1 += mir_strlen(InsertThis);
}
else p1++;
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index 12567262b6..1103d33dd8 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -224,14 +224,14 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM mir_snprintf(str, SIZEOF(str), "Font%d", i);
if ((i == 17 && !strcmp(szMod, CHATFONT_MODULE)) || ((i == 20 || i == 21) && !strcmp(szMod, FONTMODULE))) {
lf->lfCharSet = SYMBOL_CHARSET;
- lstrcpyn(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
}
else {
ptrT tszDefFace(db_get_tsa(NULL, szMod, str));
if (tszDefFace == NULL)
- lstrcpy(lf->lfFaceName, fol[j].szDefFace);
+ mir_tstrcpy(lf->lfFaceName, fol[j].szDefFace);
else
- lstrcpyn(lf->lfFaceName, tszDefFace, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, tszDefFace, SIZEOF(lf->lfFaceName));
}
}
}
@@ -885,11 +885,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (idList) {
const TCHAR *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
- lstrcat(tszDirectory, _T("\\"));
+ mir_tstrcat(tszDirectory, _T("\\"));
TCHAR tszTemp[MAX_PATH];
PathToRelativeT(tszDirectory, tszTemp, szUserDir);
- SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), mir_tstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 722d902956..6e76d1a302 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -58,15 +58,15 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT // cut nickname if larger than x chars...
TCHAR newcontactname[128];
- if (lstrlen(contactName) > 0) {
+ if (mir_tstrlen(contactName) > 0) {
if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
- lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
+ mir_tstrncpy(newcontactname, contactName, SIZEOF(newcontactname));
newcontactname[127] = 0;
}
}
- else lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname));
+ else mir_tstrncpy(newcontactname, _T("_U_"), SIZEOF(newcontactname));
newData.item.pszText = newcontactname;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 2c803e4b98..dcbb4947e2 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -103,7 +103,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa va_list marker;
static TCHAR szBuf[4 * 1024];
- if (!fmt || lstrlen(fmt) == 0 || lstrlen(fmt) > 2000)
+ if (!fmt || mir_tstrlen(fmt) == 0 || mir_tstrlen(fmt) > 2000)
return 0;
va_start(marker, fmt);
@@ -122,7 +122,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
pcli->pfnGetContactDisplayName(hContact, 0));
- lstrcpyn(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
+ mir_tstrncpy(pd.lptzText, TranslateTS(szBuf), MAX_SECONDLINE);
pd.iSeconds = g_Settings.iPopupTimeout;
if (g_Settings.iPopupStyle == 2) {
@@ -554,10 +554,10 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO if (pszWordText)
mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
else
- lstrcpyn(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
+ mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
- if (lstrlen(szTemp) > 40)
- lstrcpyn(szTemp + 40, _T("..."), 4);
+ if (mir_tstrlen(szTemp) > 40)
+ mir_tstrncpy(szTemp + 40, _T("..."), 4);
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index 23489fd0c9..1fb1a58d68 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -208,7 +208,7 @@ bool IsStringValidLink(TCHAR* pszText) { if (pszText == NULL) return false; - if (lstrlen(pszText) < 5 || _tcschr(pszText, '"')) + if (mir_tstrlen(pszText) < 5 || _tcschr(pszText, '"')) return false; if (_totlower(pszText[0]) == 'w' && _totlower(pszText[1]) == 'w' && _totlower(pszText[2]) == 'w' && pszText[3] == '.' && _istalnum(pszText[4])) @@ -1535,11 +1535,11 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, break; } if (wParam == '\b' && si->szSearch[0]) // backspace - si->szSearch[lstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; else if (wParam < ' ') break; else { - if (lstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) { + if (mir_tstrlen(si->szSearch) >= SIZEOF(si->szSearch) - 2) { MessageBeep(MB_OK); break; } @@ -1557,7 +1557,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, for (i=0; i < iItems; i++) { USERINFO *ui = pci->UM_FindUserFromIndex(si->pUsers, i); if (ui) { - if (!_tcsnicmp(ui->pszNick, si->szSearch, lstrlen(si->szSearch))) { + if (!_tcsnicmp(ui->pszNick, si->szSearch, mir_tstrlen(si->szSearch))) { SendMessage(hwnd, LB_SETSEL, FALSE, -1); SendMessage(hwnd, LB_SETSEL, TRUE, i); si->iSearchItem = i; @@ -1568,7 +1568,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, } if (i == iItems) { MessageBeep(MB_OK); - si->szSearch[lstrlen(si->szSearch) - 1] = '\0'; + si->szSearch[mir_tstrlen(si->szSearch) - 1] = '\0'; return 0; } } @@ -1994,11 +1994,11 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar dat->wStatus = si->wStatus; const TCHAR *szNick = dat->cache->getNick(); - if (lstrlen(szNick) > 0) { + if (mir_tstrlen(szNick) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(szNick, dat->newtitle, SIZEOF(dat->newtitle)); else { - lstrcpyn(dat->newtitle, szNick, SIZEOF(dat->newtitle)); + mir_tstrncpy(dat->newtitle, szNick, SIZEOF(dat->newtitle)); dat->newtitle[129] = 0; } } @@ -2096,7 +2096,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar if (si->ptszStatusbarText) mir_sntprintf(szFinalStatusBarText, SIZEOF(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText); else { - lstrcpyn(szFinalStatusBarText, mi->ptszModDispName, SIZEOF(szFinalStatusBarText)); + mir_tstrncpy(szFinalStatusBarText, mi->ptszModDispName, SIZEOF(szFinalStatusBarText)); szFinalStatusBarText[511] = 0; } } @@ -2332,16 +2332,16 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar SIZE sz; if (si->iSearchItem != -1 && si->iSearchItem == index && si->szSearch[0]) { COLORREF clr_orig = GetTextColor(dis->hDC); - GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(si->szSearch), &sz); + GetTextExtentPoint32(dis->hDC, ui->pszNick, mir_tstrlen(si->szSearch), &sz); SetTextColor(dis->hDC, RGB(250, 250, 0)); - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(si->szSearch)); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, mir_tstrlen(si->szSearch)); SetTextColor(dis->hDC, clr_orig); x_offset += sz.cx; - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + lstrlen(si->szSearch), lstrlen(ui->pszNick) - lstrlen(si->szSearch)); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick + mir_tstrlen(si->szSearch), mir_tstrlen(ui->pszNick) - mir_tstrlen(si->szSearch)); } else { - GetTextExtentPoint32(dis->hDC, ui->pszNick, lstrlen(ui->pszNick), &sz); - TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, lstrlen(ui->pszNick)); + GetTextExtentPoint32(dis->hDC, ui->pszNick, mir_tstrlen(ui->pszNick), &sz); + TextOut(dis->hDC, x_offset, (dis->rcItem.top + dis->rcItem.bottom - sz.cy) / 2, ui->pszNick, mir_tstrlen(ui->pszNick)); SelectObject(dis->hDC, hOldFont); } return TRUE; @@ -2665,7 +2665,7 @@ LABEL_SHOWWINDOW: int iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr); if (iRes > 0) { - int iLen = lstrlen(pszWord) - 1; + int iLen = mir_tstrlen(pszWord) - 1; while (iLen >= 0 && strchr(szTrimString, pszWord[iLen])) { pszWord[iLen] = '\0'; iLen--; @@ -2785,8 +2785,8 @@ LABEL_SHOWWINDOW: break; EmptyClipboard(); { - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (lstrlen(tr.lpstrText) + 1)); - lstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR) * (mir_tstrlen(tr.lpstrText) + 1)); + mir_tstrcpy((TCHAR*)GlobalLock(hData), tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); } @@ -2842,7 +2842,7 @@ LABEL_SHOWWINDOW: else if (msg == WM_LBUTTONUP) { USERINFO *ui = si->pUsers; SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_EXGETSEL, 0, (LPARAM)&chr); - size_t bufSize = lstrlen(tr.lpstrText) + lstrlen(tszAplTmpl) + 3; + size_t bufSize = mir_tstrlen(tr.lpstrText) + mir_tstrlen(tszAplTmpl) + 3; tszTmp = tszAppeal = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR)); tr2.lpstrText = (LPTSTR) mir_alloc(sizeof(TCHAR) * 2); if (chr.cpMin) { @@ -2857,7 +2857,7 @@ LABEL_SHOWWINDOW: else /* in the beginning of the message window */ mir_sntprintf(tszAppeal, bufSize, tszAplTmpl, tr.lpstrText); - st = lstrlen(tszAppeal); + st = mir_tstrlen(tszAppeal); if (chr.cpMax != -1) { tr2.chrg.cpMin = chr.cpMax; tr2.chrg.cpMax = chr.cpMax + 1; diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp index 22a445fe3d..df70c33104 100644 --- a/plugins/TabSRMM/src/contactcache.cpp +++ b/plugins/TabSRMM/src/contactcache.cpp @@ -467,7 +467,7 @@ void CContactCache::updateStatusMsg(const char *szKey) m_szStatusMsg = 0; ptrT szStatus(db_get_tsa(hContact, "CList", "StatusMsg")); if (szStatus != 0) - m_szStatusMsg = (lstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0); + m_szStatusMsg = (mir_tstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0); } if (szKey == 0 || (szKey && !strcmp("ListeningTo", szKey))) { if (m_ListeningInfo) @@ -545,7 +545,7 @@ TCHAR* CContactCache::getNormalizedStatusMsg(const TCHAR *src, bool fStripAll) size_t k = 0, i = 0; TCHAR* tszResult = 0; - if (src == 0 || lstrlen(src) < 2) + if (src == 0 || mir_tstrlen(src) < 2) return 0; tstring dest; diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp index 929308b88d..727a1d09ca 100644 --- a/plugins/TabSRMM/src/container.cpp +++ b/plugins/TabSRMM/src/container.cpp @@ -1865,7 +1865,7 @@ panel_found: char szCName[40]; mir_snprintf(szCName, 40, "%s_theme", CONTAINER_PREFIX); - if (lstrlen(pContainer->szRelThemeFile) > 1) { + if (mir_tstrlen(pContainer->szRelThemeFile) > 1) { if (pContainer->fPrivateThemeChanged == TRUE) { PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath()); db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile); @@ -1990,8 +1990,8 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size { int cutMax = PluginConfig.m_CutContactNameTo; - if (lstrlen(oldname) <= cutMax) { - lstrcpyn(newname, oldname, size); + if (mir_tstrlen(oldname) <= cutMax) { + mir_tstrncpy(newname, oldname, size); newname[size - 1] = 0; } else { @@ -2023,7 +2023,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer) TContainerData* TSAPI FindContainerByName(const TCHAR *name) { - if (name == NULL || lstrlen(name) == 0) + if (name == NULL || mir_tstrlen(name) == 0) return 0; if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container @@ -2188,7 +2188,7 @@ void TSAPI DeleteContainer(int iIndex) void TSAPI RenameContainer(int iIndex, const TCHAR *szNew) { - if (lstrlen(szNew) == 0) + if (mir_tstrlen(szNew) == 0) return; char szIndex[10]; diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index 7af5e2671e..173308a77f 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -491,7 +491,7 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe) iPreviewLimit = 500;
TCHAR* buf = DbGetEventTextT(dbe, CP_ACP);
- if (lstrlen(buf) > iPreviewLimit) {
+ if (mir_tstrlen(buf) > iPreviewLimit) {
fAddEllipsis = true;
int iIndex = iPreviewLimit;
int iWordThreshold = 20;
@@ -501,7 +501,7 @@ static TCHAR* ShortenPreview(DBEVENTINFO* dbe) buf[iIndex] = 0;
}
if (fAddEllipsis) {
- buf = (TCHAR*)mir_realloc(buf, (lstrlen(buf) + 5) * sizeof(TCHAR));
+ buf = (TCHAR*)mir_realloc(buf, (mir_tstrlen(buf) + 5) * sizeof(TCHAR));
_tcscat(buf, _T("..."));
}
return buf;
@@ -602,12 +602,12 @@ static int PopupUpdateT(MCONTACT hContact, HANDLE hEvent) int i, available = MAX_SECONDLINE - 1;
if (pdata->pluginOptions->bShowHeaders) {
_tcsncpy(lpzText, szHeader, MAX_SECONDLINE);
- available -= lstrlen(szHeader);
+ available -= mir_tstrlen(szHeader);
}
else lpzText[0] = 0;
for (i = pdata->nrMerged; i >= 0; i--) {
- available -= lstrlen(pdata->eventData[i].tszText);
+ available -= mir_tstrlen(pdata->eventData[i].tszText);
if (available <= 0)
break;
}
@@ -748,7 +748,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced) mii.dwItemData = 0;
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, FALSE, &mii);
@@ -814,7 +814,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
mir_sntprintf(szMenuEntry, SIZEOF(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
SetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index a36fb66943..3f95a9d939 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1064,8 +1064,8 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat) else if (dat->lastMessage) { TCHAR date[64], time[64]; tmi.printTimeStamp(NULL, dat->lastMessage, _T("d"), date, SIZEOF(date), 0); - if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && lstrlen(date) > 6) - date[lstrlen(date) - 5] = 0; + if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6) + date[mir_tstrlen(date) - 5] = 0; tmi.printTimeStamp(NULL, dat->lastMessage, _T("t"), time, SIZEOF(time), 0); mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Last received: %s at %s"), date, time); } @@ -1109,16 +1109,16 @@ LRESULT TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, UINT msg, WPARAM w HANDLE hClip = GetClipboardData(CF_UNICODETEXT); if (!hClip) goto err_out; - TCHAR *tszText = (TCHAR*)mir_alloc((lstrlen((TCHAR*)hClip) + 2) * sizeof(TCHAR)); + TCHAR *tszText = (TCHAR*)mir_alloc((mir_tstrlen((TCHAR*)hClip) + 2) * sizeof(TCHAR)); if (!tszText) goto err_out; - lstrcpy(tszText, (TCHAR*)hClip); + mir_tstrcpy(tszText, (TCHAR*)hClip); Utils::FilterEventMarkers(tszText); EmptyClipboard(); - HGLOBAL hgbl = GlobalAlloc(GMEM_MOVEABLE, (lstrlen(tszText) + 1) * sizeof(TCHAR)); + HGLOBAL hgbl = GlobalAlloc(GMEM_MOVEABLE, (mir_tstrlen(tszText) + 1) * sizeof(TCHAR)); TCHAR *tszLocked = (TCHAR*)GlobalLock(hgbl); - lstrcpy(tszLocked, tszText); + mir_tstrcpy(tszLocked, tszText); GlobalUnlock(hgbl); SetClipboardData(CF_UNICODETEXT, hgbl); mir_free(tszText); @@ -1763,11 +1763,11 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) if (PluginConfig.m_CutContactNameOnTabs) CutContactName(szNick, newcontactname, SIZEOF(newcontactname)); else - lstrcpyn(newcontactname, szNick, SIZEOF(newcontactname)); + mir_tstrncpy(newcontactname, szNick, SIZEOF(newcontactname)); Utils::DoubleAmpersands(newcontactname); - if (lstrlen(newcontactname) != 0 && dat->szStatus != NULL) { + if (mir_tstrlen(newcontactname) != 0 && dat->szStatus != NULL) { if (PluginConfig.m_StatusOnTabs) mir_sntprintf(newtitle, 127, _T("%s (%s)"), newcontactname, dat->szStatus); else @@ -1792,7 +1792,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam) SendMessage(GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR); } } - else lstrcpyn(newtitle, _T("Message Session"), SIZEOF(newtitle)); + else mir_tstrncpy(newtitle, _T("Message Session"), SIZEOF(newtitle)); if (dat->idle != dwOldIdle || lParam != 0) { if (item.mask & TCIF_TEXT) { diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 2be3094c7a..03d1ff2daf 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -429,7 +429,7 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam) fChanged = c->updateStatus();
fNickChanged = c->updateNick();
}
- if (lstrlenA(setting) > 6 && lstrlenA(setting) < 9 && !strncmp(setting, "Status", 6)) {
+ if (mir_strlen(setting) > 6 && mir_strlen(setting) < 9 && !strncmp(setting, "Status", 6)) {
fChanged = true;
if (c) {
c->updateMeta();
@@ -443,7 +443,7 @@ int CGlobals::DBSettingChanged(WPARAM hContact, LPARAM lParam) c->updateUIN();
PostMessage(hwnd, DM_UPDATEUIN, 0, 0);
}
- else if (lstrlenA(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
+ else if (mir_strlen(setting) > 6 && strstr("StatusMsg,XStatusMsg,XStatusName,XStatusId,ListeningTo", setting)) {
if (c) {
c->updateStatusMsg(setting);
fExtendedStatusChange = true;
@@ -624,7 +624,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c) ptrA szMsg(mir_utf8encodeT(text));
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.pBlob = (PBYTE)(char*)szMsg;
- dbei.cbBlob = lstrlenA(szMsg) + 1;
+ dbei.cbBlob = mir_strlen(szMsg) + 1;
dbei.flags = DBEF_UTF | DBEF_READ;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
dbei.timestamp = time(NULL);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index 30fafd3cd5..19bce88c6e 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -431,9 +431,9 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) if (szStatusMsg) {
SIZE sStatusMsg, sMask;
- ::GetTextExtentPoint32(hdc, szTextToShow, lstrlen(szTextToShow), &m_szNick);
+ ::GetTextExtentPoint32(hdc, szTextToShow, mir_tstrlen(szTextToShow), &m_szNick);
::GetTextExtentPoint32(hdc, _T("A"), 1, &sMask);
- ::GetTextExtentPoint32(hdc, szStatusMsg, lstrlen(szStatusMsg), &sStatusMsg);
+ ::GetTextExtentPoint32(hdc, szStatusMsg, mir_tstrlen(szStatusMsg), &sStatusMsg);
DWORD dtFlagsNick = DT_SINGLELINE | DT_WORD_ELLIPSIS | DT_NOPREFIX;
if ((m_szNick.cx + sStatusMsg.cx + 6) < (rcItem.right - rcItem.left) || (rcItem.bottom - rcItem.top) < (2 * sMask.cy)) {
@@ -466,7 +466,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT& rcItem) CSkin::RenderText(hdc, m_dat->hThemeIP, szStatusMsg, &rcItem, dtFlags, CSkin::m_glowSize, clr);
}
else {
- GetTextExtentPoint32(hdc, szTextToShow, lstrlen(szTextToShow), &m_szNick);
+ GetTextExtentPoint32(hdc, szTextToShow, mir_tstrlen(szTextToShow), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
setUnderlinedFont(hdc, fShowUin ? m_ipConfig.hFonts[IPFONTID_UIN] : m_ipConfig.hFonts[IPFONTID_NICK]);
@@ -522,7 +522,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) }
SIZE sUIN;
- ::GetTextExtentPoint32(hdc, szBuf, lstrlen(szBuf), &sUIN);
+ ::GetTextExtentPoint32(hdc, szBuf, mir_tstrlen(szBuf), &sUIN);
mapRealRect(rcItem, m_rcUIN, sUIN);
CSkin::RenderText(hdc, m_dat->hThemeIP, szBuf, &rcItem, DT_SINGLELINE | DT_VCENTER, CSkin::m_glowSize, clr);
}
@@ -545,7 +545,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) DWORD oldPanelStatusCX = m_dat->panelStatusCX;
if (m_dat->szStatus[0])
- GetTextExtentPoint32(hdc, m_dat->szStatus, lstrlen(m_dat->szStatus), &sStatus);
+ GetTextExtentPoint32(hdc, m_dat->szStatus, mir_tstrlen(m_dat->szStatus), &sStatus);
/*
* figure out final account name
@@ -553,13 +553,13 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem) const TCHAR *szFinalProto = m_dat->cache->getRealAccount();
if (szFinalProto) {
SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_PROTO]);
- GetTextExtentPoint32(hdc, szFinalProto, lstrlen(szFinalProto), &sProto);
+ GetTextExtentPoint32(hdc, szFinalProto, mir_tstrlen(szFinalProto), &sProto);
}
TCHAR szResult[80]; szResult[0] = 0;
if (m_dat->hTimeZone) {
tmi.printDateTime(m_dat->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0);
- GetTextExtentPoint32(hdc, szResult, lstrlen(szResult), &sTime);
+ GetTextExtentPoint32(hdc, szResult, mir_tstrlen(szResult), &sTime);
}
m_dat->panelStatusCX = 3 + sStatus.cx + sProto.cx + 14 + (m_dat->hClientIcon ? 20 : 0) + sTime.cx + 13;
@@ -641,7 +641,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem) const TCHAR *tszNick = m_dat->cache->getNick();
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(hdc, tszNick, lstrlen(tszNick), &m_szNick);
+ ::GetTextExtentPoint32(hdc, tszNick, mir_tstrlen(tszNick), &m_szNick);
mapRealRect(rcItem, m_rcNick, m_szNick);
if (m_hoverFlags & HOVER_NICK)
@@ -689,7 +689,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) SIZE szTitle;
TCHAR szPrefix[100];
mir_sntprintf(szPrefix, 100, TranslateT("Topic is: %s"), _T(""));
- ::GetTextExtentPoint32(hdc, szPrefix, lstrlen(szPrefix), &szTitle);
+ ::GetTextExtentPoint32(hdc, szPrefix, mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
setUnderlinedFont(hdc, m_ipConfig.hFonts[IPFONTID_UIN]);
@@ -698,7 +698,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem) rcItem.left += (szTitle.cx + 4);
if (m_hoverFlags & HOVER_UIN)
::DeleteObject(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
- if (si->ptszTopic && lstrlen(si->ptszTopic) > 1)
+ if (si->ptszTopic && mir_tstrlen(si->ptszTopic) > 1)
CSkin::RenderText(hdc, m_dat->hThemeIP, si->ptszTopic, &rcItem, DT_WORDBREAK | DT_END_ELLIPSIS | DT_NOPREFIX | DT_TOP, CSkin::m_glowSize, clr);
else
CSkin::RenderText(hdc, m_dat->hThemeIP, TranslateT("no topic set."), &rcItem, DT_TOP| DT_SINGLELINE | DT_NOPREFIX, CSkin::m_glowSize, clr);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp index bdf6efb0a5..f0ff2f09d4 100644 --- a/plugins/TabSRMM/src/mim.cpp +++ b/plugins/TabSRMM/src/mim.cpp @@ -133,9 +133,9 @@ const TCHAR* CMimAPI::getUserDir() { if (m_userDir[0] == 0) { if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) - lstrcpyn(m_userDir, L"%miranda_userdata%", SIZEOF(m_userDir)); + mir_tstrncpy(m_userDir, L"%miranda_userdata%", SIZEOF(m_userDir)); else - lstrcpyn(m_userDir, VARST(_T("%miranda_userdata%")), SIZEOF(m_userDir)); + mir_tstrncpy(m_userDir, VARST(_T("%miranda_userdata%")), SIZEOF(m_userDir)); Utils::ensureTralingBackslash(m_userDir); } @@ -152,12 +152,12 @@ void CMimAPI::InitPaths() mir_sntprintf(m_szProfilePath, MAX_PATH, _T("%stabSRMM"), szUserdataDir); if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) { - lstrcpyn(m_szChatLogsPath, _T("%miranda_logpath%"), MAX_PATH); - lstrcpyn(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), MAX_PATH); + mir_tstrncpy(m_szChatLogsPath, _T("%miranda_logpath%"), MAX_PATH); + mir_tstrncpy(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), MAX_PATH); } else { - lstrcpyn(m_szChatLogsPath, VARST(_T("%miranda_logpath%")), MAX_PATH); - lstrcpyn(m_szSkinsPath, VARST(_T("%miranda_path%\\Skins\\TabSRMM")), MAX_PATH); + mir_tstrncpy(m_szChatLogsPath, VARST(_T("%miranda_logpath%")), MAX_PATH); + mir_tstrncpy(m_szSkinsPath, VARST(_T("%miranda_path%\\Skins\\TabSRMM")), MAX_PATH); } Utils::ensureTralingBackslash(m_szChatLogsPath); diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index 5b6e109612..1e91712136 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -122,7 +122,7 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam) if (res == 0)
break;
- bufSize = textlenght + lstrlen(pszMenu[res - 1]) + 2;
+ bufSize = textlenght + mir_tstrlen(pszMenu[res - 1]) + 2;
pszFormatedText = (TCHAR*)_alloca(bufSize*sizeof(TCHAR));
mir_sntprintf(pszFormatedText, bufSize, pszMenu[res-1], pszText);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index 9b334fb22f..1735b763a8 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -624,7 +624,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if (OpenClipboard(hwnd)) { HANDLE hClip = GetClipboardData(CF_TEXT); if (hClip) { - if (lstrlenA((char*)hClip) > mwdat->nMax) { + if (mir_strlen((char*)hClip) > mwdat->nMax) { TCHAR szBuffer[512]; if (M.GetByte("autosplit", 0)) mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10); @@ -2112,9 +2112,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break; EmptyClipboard(); - HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1)); + HGLOBAL hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1)); TCHAR *buf = (TCHAR*)GlobalLock(hData); - lstrcpy(buf, tr.lpstrText); + mir_tstrcpy(buf, tr.lpstrText); GlobalUnlock(hData); SetClipboardData(CF_UNICODETEXT, hData); CloseClipboard(); @@ -2751,7 +2751,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int memRequired = 0, flags = 0; if (!IsUtfSendAvailable(dat->hContact)) { flags |= PREF_UNICODE; - memRequired = bufSize + ((lstrlenW(decoded) + 1) * sizeof(WCHAR)); + memRequired = bufSize + ((mir_wstrlen(decoded) + 1) * sizeof(WCHAR)); } else { flags |= PREF_UTF; @@ -2788,7 +2788,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP else { WideCharToMultiByte(dat->codePage, 0, decoded, -1, dat->sendBuffer, bufSize, 0, 0); if (flags & PREF_UNICODE) - CopyMemory(&dat->sendBuffer[bufSize], decoded, (lstrlenW(decoded) + 1) * sizeof(WCHAR)); + CopyMemory(&dat->sendBuffer[bufSize], decoded, (mir_wstrlen(decoded) + 1) * sizeof(WCHAR)); } if (memRequired == 0 || dat->sendBuffer[0] == 0) @@ -2896,13 +2896,13 @@ quote_from_last: } } if (dbei.eventType == EVENTTYPE_FILE) { - int iDescr = lstrlenA((char *)(szText + sizeof(DWORD))); + int iDescr = mir_strlen((char *)(szText + sizeof(DWORD))); MoveMemory(szText, szText + sizeof(DWORD), iDescr); MoveMemory(szText + iDescr + 2, szText + sizeof(DWORD)+iDescr, dbei.cbBlob - iDescr - sizeof(DWORD)-1); szText[iDescr] = '\r'; szText[iDescr + 1] = '\n'; - szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + lstrlenA((char *)szText))); - MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + lstrlenA((char *)szText)); + szConverted = (TCHAR*)mir_alloc(sizeof(TCHAR)* (1 + mir_strlen((char *)szText))); + MultiByteToWideChar(CP_ACP, 0, (char *)szText, -1, szConverted, 1 + mir_strlen((char *)szText)); iAlloced = true; } ptrT szQuoted(QuoteText(szConverted, iCharsPerLine, 0)); @@ -3078,7 +3078,7 @@ quote_from_last: case DM_MYAVATARCHANGED: { const char *szProto = dat->cache->getActiveProto(); - if (!strcmp((char *)wParam, szProto) && lstrlenA(szProto) == lstrlenA((char *)wParam)) + if (!strcmp((char *)wParam, szProto) && mir_strlen(szProto) == mir_strlen((char *)wParam)) LoadOwnAvatar(dat); } break; diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 85bad73929..07bc06b0b0 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -291,7 +291,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID) szText = TranslateT("Set Your Avatar...");
}
mii.dwTypeData = szText;
- mii.cch = lstrlen(szText) + 1;
+ mii.cch = mir_tstrlen(szText) + 1;
SetMenuItemInfo(submenu, ID_PICMENU_SETTINGS, FALSE, &mii);
}
else if (menuID == MENU_PANELPICMENU) {
@@ -453,13 +453,13 @@ void TSAPI UpdateReadChars(const TWindowData *dat) TCHAR szBuf[20]; szBuf[0] = 0;
if (dat->fInsertMode)
- lstrcat(szBuf, _T("O"));
+ mir_tstrcat(szBuf, _T("O"));
if (fCaps)
- lstrcat(szBuf, _T("C"));
+ mir_tstrcat(szBuf, _T("C"));
if (fNum)
- lstrcat(szBuf, _T("N"));
+ mir_tstrcat(szBuf, _T("N"));
if (dat->fInsertMode || fCaps || fNum)
- lstrcat(szBuf, _T(" | "));
+ mir_tstrcat(szBuf, _T(" | "));
mir_sntprintf(buf, SIZEOF(buf), _T("%s%s %d/%d"), szBuf, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
@@ -663,7 +663,7 @@ TCHAR* TSAPI QuoteText(const TCHAR *text, int charsPerLine, int removeExistingQu int justDoneLineBreak, bufSize;
TCHAR *strout;
- bufSize = lstrlenW(text) + 23;
+ bufSize = mir_wstrlen(text) + 23;
strout = (TCHAR*)mir_alloc(bufSize * sizeof(TCHAR));
inChar = 0;
justDoneLineBreak = 1;
@@ -887,7 +887,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) TCHAR InsertThis[50];
p1 += 5;
- MoveMemory(pszText, p1, (lstrlen(p1) + 1) * sizeof(TCHAR));
+ MoveMemory(pszText, p1, (mir_tstrlen(p1) + 1) * sizeof(TCHAR));
p1 = pszText;
// iterate through all characters, if rtf control character found then take action
while (*p1 != '\0') {
@@ -903,7 +903,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) bJustRemovedRTF = TRUE;
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), iCol);
- iRemoveChars = 3 + lstrlen(szTemp);
+ iRemoveChars = 3 + mir_tstrlen(szTemp);
if (bTextHasStarted || iCol)
mir_sntprintf(InsertThis, SIZEOF(InsertThis), (iInd > 0) ? (inColor ? _T("[/color][color=%s]") : _T("[color=%s]")) : (inColor ? _T("[/color]") : _T("")), Utils::rtf_ctable[iInd - 1].szName);
inColor = iInd > 0 ? 1 : 0;
@@ -914,7 +914,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) bJustRemovedRTF = TRUE;
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), iCol);
- iRemoveChars = 10 + lstrlen(szTemp);
+ iRemoveChars = 10 + mir_tstrlen(szTemp);
}
else if (!_tcsncmp(p1, _T("\\par"), 4)) { // newline
bTextHasStarted = TRUE;
@@ -1079,7 +1079,7 @@ BOOL TSAPI DoRtfToTags(TCHAR *pszText, const TWindowData *dat) // move the memory and paste in new commands instead of the old RTF
if (InsertThis[0] || iRemoveChars) {
size_t cbLen = _tcslen(InsertThis);
- MoveMemory(p1 + cbLen, p1 + iRemoveChars, (lstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR));
+ MoveMemory(p1 + cbLen, p1 + iRemoveChars, (mir_tstrlen(p1) - iRemoveChars + 1) * sizeof(TCHAR));
CopyMemory(p1, InsertThis, cbLen * sizeof(TCHAR));
p1 += cbLen;
}
@@ -1709,7 +1709,7 @@ void TSAPI LoadOverrideTheme(TContainerData *pContainer) BOOL bReadTemplates = TRUE;
ZeroMemory(&pContainer->theme, sizeof(TLogTheme));
- if (lstrlen(pContainer->szAbsThemeFile) > 1) {
+ if (mir_tstrlen(pContainer->szAbsThemeFile) > 1) {
if (PathFileExists(pContainer->szAbsThemeFile)) {
if (CheckThemeVersion(pContainer->szAbsThemeFile) == 0) {
LoadThemeDefaults(pContainer);
@@ -1828,7 +1828,7 @@ void TSAPI GetMyNick(TWindowData *dat) if (!CallService(MS_CONTACT_GETCONTACTINFO, 0, (LPARAM)&ci)) {
if (ci.type == CNFT_ASCIIZ) {
- if (lstrlen(reinterpret_cast<TCHAR *>(ci.pszVal)) < 1 || !_tcscmp(reinterpret_cast<TCHAR *>(ci.pszVal),
+ if (mir_tstrlen(reinterpret_cast<TCHAR *>(ci.pszVal)) < 1 || !_tcscmp(reinterpret_cast<TCHAR *>(ci.pszVal),
TranslateT("'(Unknown Contact)'"))) {
mir_sntprintf(dat->szMyNickname, SIZEOF(dat->szMyNickname), _T("%s"), dat->myUin[0] ? dat->myUin : TranslateT("'(Unknown Contact)'"));
if (ci.pszVal) {
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index e5299a53da..d7999714e6 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -114,7 +114,7 @@ __forceinline char *GetRTFFont(DWORD dwIndex) static void TrimMessage(TCHAR *msg)
{
- size_t iLen = lstrlen(msg) - 1;
+ size_t iLen = mir_tstrlen(msg) - 1;
size_t i = iLen;
while (i && (msg[i] == '\r' || msg[i] == '\n')) {
@@ -594,7 +594,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, }
if (dbei.eventType == EVENTTYPE_MESSAGE && !dbei.markedRead())
- dat->cache->updateStats(TSessionStats::SET_LAST_RCV, lstrlenA((char *)dbei.pBlob));
+ dat->cache->updateStats(TSessionStats::SET_LAST_RCV, mir_strlen((char *)dbei.pBlob));
TCHAR *formatted = NULL;
if (rtfMessage == NULL) {
@@ -693,7 +693,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, szTemplate = isSent ? this_templateset->szTemplates[TMPL_MSGOUT] : this_templateset->szTemplates[TMPL_MSGIN];
}
- size_t iTemplateLen = lstrlen(szTemplate);
+ size_t iTemplateLen = mir_tstrlen(szTemplate);
BOOL showTime = dwEffectiveFlags & MWF_LOG_SHOWTIME;
BOOL showDate = dwEffectiveFlags & MWF_LOG_SHOWDATES;
@@ -997,7 +997,7 @@ static char *Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, AppendToBuffer(&buffer, &bufferEnd, &bufferAlloced, "%s ", GetRTFFont(isSent ? MSGFONTID_MYMISC + iFontIDOffset : MSGFONTID_YOURMISC + iFontIDOffset));
{
char *szFileName = (char *)dbei.pBlob + sizeof(DWORD);
- char *szDescr = szFileName + lstrlenA(szFileName) + 1;
+ char *szDescr = szFileName + mir_strlen(szFileName) + 1;
TCHAR *tszFileName = DbGetEventStringT(&dbei, szFileName);
if (*szDescr != 0) {
TCHAR *tszDescr = DbGetEventStringT(&dbei, szDescr);
@@ -1188,7 +1188,7 @@ static DWORD CALLBACK LogStreamInEvents(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG *pcb = 0;
return 0;
}
- dat->bufferLen = lstrlenA(dat->buffer);
+ dat->bufferLen = mir_strlen(dat->buffer);
}
*pcb = min(cb, dat->bufferLen - dat->bufferOffset);
CopyMemory(pbBuff, dat->buffer + dat->bufferOffset, *pcb);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index aa1e922fcf..f498505fec 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -109,7 +109,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
while (h != INVALID_HANDLE_VALUE) {
- if (lstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + lstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
+ if (mir_tstrlen(fd.cFileName) >= 5 && !_tcsnicmp(fd.cFileName + mir_tstrlen(fd.cFileName) - 4, _T(".tsk"), 4)) {
fValid = true;
break;
}
@@ -128,13 +128,13 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox) GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, 500, tszFinalName);
if (!_tcscmp(szBuf, _T("None"))) {
- fd.cFileName[lstrlen(fd.cFileName) - 4] = 0;
+ fd.cFileName[mir_tstrlen(fd.cFileName) - 4] = 0;
mir_sntprintf(szBuf, 255, _T("%s"), fd.cFileName);
}
PathToRelativeT(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
- TCHAR *idata = (TCHAR*)mir_alloc((lstrlen(tszRel) + 1) * sizeof(TCHAR));
+ TCHAR *idata = (TCHAR*)mir_alloc((mir_tstrlen(tszRel) + 1) * sizeof(TCHAR));
_tcscpy(idata, tszRel);
SendMessage(hwndCombobox, CB_SETITEMDATA, lr, (LPARAM)idata);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 8356b7f1fd..93caf5f1bf 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -68,14 +68,14 @@ static INT_PTR GetWindowClass(WPARAM wParam, LPARAM lParam) return 0; } -//wparam = (MessageWindowInputData*)
-//lparam = (MessageWindowData*)
+//wparam = (MessageWindowInputData*) +//lparam = (MessageWindowData*) //returns 0 on success and returns non-zero (1) on error or if no window data exists for that hcontact static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam) { MessageWindowInputData *mwid = (MessageWindowInputData*)wParam; - if (mwid == NULL || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == NULL) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH))
+ if (mwid == NULL || (mwid->cbSize != sizeof(MessageWindowInputData)) || (mwid->hContact == NULL) || (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)) return 1; MessageWindowData *mwd = (MessageWindowData*)lParam; @@ -562,16 +562,16 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, // cut nickname if larger than x chars... TCHAR newcontactname[128], tabtitle[128]; - if (contactName && lstrlen(contactName) > 0) { + if (contactName && mir_tstrlen(contactName) > 0) { if (M.GetByte("cuttitle", 0)) CutContactName(contactName, newcontactname, SIZEOF(newcontactname)); else { - lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname)); + mir_tstrncpy(newcontactname, contactName, SIZEOF(newcontactname)); newcontactname[127] = 0; } Utils::DoubleAmpersands(newcontactname); } - else lstrcpyn(newcontactname, _T("_U_"), SIZEOF(newcontactname)); + else mir_tstrncpy(newcontactname, _T("_U_"), SIZEOF(newcontactname)); WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE)); TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0); diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp index 4cc465c702..efd3803e87 100644 --- a/plugins/TabSRMM/src/selectcontainer.cpp +++ b/plugins/TabSRMM/src/selectcontainer.cpp @@ -117,7 +117,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L if (iItem != LB_ERR) {
TCHAR szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
- if (lstrlen(szOldName) == lstrlen(szNewName)) {
+ if (mir_tstrlen(szOldName) == mir_tstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
@@ -132,7 +132,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L RenameContainer(iIndex, szNewName);
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_RESETCONTENT, 0, 0);
for (TContainerData *p = pFirstContainer; p; p = p->pNext) {
- if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && lstrlen(p->szName) == lstrlen(szName)) {
+ if (!_tcsncmp(p->szName, szName, CONTAINER_NAMELEN) && mir_tstrlen(p->szName) == mir_tstrlen(szName)) {
_tcsncpy(p->szName, szNewName, CONTAINER_NAMELEN);
SendMessage(p->hwnd, DM_CONFIGURECONTAINER, 0, 0);
}
@@ -153,7 +153,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L int iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM)- 1, (LPARAM)szNewName);
if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
- if (lstrlen(szName) == lstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
+ if (mir_tstrlen(szName) == mir_tstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp index 6dd8cbb01c..abe3a03f2b 100644 --- a/plugins/TabSRMM/src/sendlater.cpp +++ b/plugins/TabSRMM/src/sendlater.cpp @@ -131,7 +131,7 @@ CSendLaterJob::~CSendLaterJob() POPUPDATAT ppd = {0};
ppd.lchContact = hContact;
mir_sntprintf(ppd.lptzContactName, MAX_CONTACTNAME, _T("%s"), tszName ? tszName : TranslateT("'(Unknown Contact)'"));
- TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[lstrlenA((char *)pBuf) + 1]), 100);
+ TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
mir_sntprintf(ppd.lptzText, MAX_SECONDLINE, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
@@ -298,7 +298,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) DBVARIANT dbv = {0};
char *szOrig_Utf = 0;
- if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || lstrlenA(szSetting) < 8)
+ if (!m_fAvail || !szSetting || !strcmp(szSetting, "count") || mir_strlen(szSetting) < 8)
return 0;
if (szSetting[0] != 'S' && szSetting[0] != 'M')
@@ -333,7 +333,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) job->hContact = hContact;
job->created = atol(&szSetting[1]);
- int iLen = lstrlenA(szOrig_Utf);
+ int iLen = mir_strlen(szOrig_Utf);
job->sendBuffer = reinterpret_cast<char *>(mir_alloc(iLen + 1));
strncpy(job->sendBuffer, szOrig_Utf, iLen);
job->sendBuffer[iLen] = 0;
@@ -341,17 +341,17 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam) // construct conventional send buffer
wchar_t *szWchar = 0;
char *szAnsi = mir_utf8decodecp(szOrig_Utf, CP_ACP, &szWchar);
- iLen = lstrlenA(szAnsi);
+ iLen = mir_strlen(szAnsi);
UINT required = iLen + 1;
if (szWchar)
- required += ((lstrlenW(szWchar) + 1) * sizeof(wchar_t));
+ required += ((mir_wstrlen(szWchar) + 1) * sizeof(wchar_t));
job->pBuf = (PBYTE)mir_calloc(required);
strncpy((char *)job->pBuf, szAnsi, iLen);
job->pBuf[iLen] = 0;
if (szWchar)
- wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, lstrlenW(szWchar));
+ wcsncpy((wchar_t *)&job->pBuf[iLen + 1], szWchar, mir_wstrlen(szWchar));
if (szSetting[0] == 'S')
db_free(&dbv);
@@ -475,7 +475,7 @@ HANDLE CSendLater::processAck(const ACKDATA *ack) dbei.flags = DBEF_SENT;
dbei.szModule = GetContactProto((p->hContact));
dbei.timestamp = time(NULL);
- dbei.cbBlob = lstrlenA(p->sendBuffer) + 1;
+ dbei.cbBlob = mir_strlen(p->sendBuffer) + 1;
dbei.flags |= DBEF_UTF;
dbei.pBlob = (PBYTE)(p->sendBuffer);
db_event_add(p->hContact, &dbei);
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp index d9a47724af..a8b9b3f271 100644 --- a/plugins/TabSRMM/src/sendqueue.cpp +++ b/plugins/TabSRMM/src/sendqueue.cpp @@ -127,7 +127,7 @@ entry_found: static int SendChunkW(WCHAR *chunk, MCONTACT hContact, DWORD dwFlags) { - int wLen = lstrlenW(chunk); + int wLen = mir_wstrlen(chunk); DWORD memRequired = (wLen + 1) * sizeof(WCHAR); DWORD codePage = db_get_dw(hContact, SRMSGMOD_T, "ANSIcodepage", CP_ACP); @@ -157,10 +157,10 @@ static void DoSplitSendW(LPVOID param) int chunkSize = job->chunkSize / 2; char *szProto = GetContactProto(hContact); - int iLen = lstrlenA(job->szSendBuffer); + int iLen = mir_strlen(job->szSendBuffer); WCHAR *wszBegin = (WCHAR*) & job->szSendBuffer[iLen + 1]; - WCHAR *wszTemp = (WCHAR*)mir_alloc(sizeof(WCHAR) * (lstrlenW(wszBegin) + 1)); - CopyMemory(wszTemp, wszBegin, sizeof(WCHAR) * (lstrlenW(wszBegin) + 1)); + WCHAR *wszTemp = (WCHAR*)mir_alloc(sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1)); + CopyMemory(wszTemp, wszBegin, sizeof(WCHAR) * (mir_wstrlen(wszBegin) + 1)); wszBegin = wszTemp; do { @@ -231,7 +231,7 @@ static void DoSplitSendA(LPVOID param) DWORD dwFlags = job->dwFlags; int chunkSize = job->chunkSize; - iLen = lstrlenA(job->szSendBuffer); + iLen = mir_strlen(job->szSendBuffer); szTemp = (char *)mir_alloc(iLen + 1); CopyMemory(szTemp, job->szSendBuffer, iLen + 1); szBegin = szTemp; @@ -293,15 +293,15 @@ static void DoSplitSendA(LPVOID param) int SendQueue::getSendLength(const int iEntry, int sendMode) { if (m_jobs[iEntry].dwFlags & PREF_UNICODE && !(sendMode & SMODE_FORCEANSI)) { - int iLen = lstrlenA(m_jobs[iEntry].szSendBuffer); + int iLen = mir_strlen(m_jobs[iEntry].szSendBuffer); WCHAR *wszBuf = (WCHAR *) & m_jobs[iEntry].szSendBuffer[iLen + 1]; char *utf8 = mir_utf8encodeT(wszBuf); - m_jobs[iEntry].iSendLength = lstrlenA(utf8); + m_jobs[iEntry].iSendLength = mir_strlen(utf8); mir_free(utf8); return(m_jobs[iEntry].iSendLength); } else { - m_jobs[iEntry].iSendLength = lstrlenA(m_jobs[iEntry].szSendBuffer); + m_jobs[iEntry].iSendLength = mir_strlen(m_jobs[iEntry].szSendBuffer); return(m_jobs[iEntry].iSendLength); } } @@ -487,7 +487,7 @@ void SendQueue::logError(const TWindowData *dat, int iSendJobIndex, const TCHAR dbei.eventType = EVENTTYPE_ERRMSG; if (iSendJobIndex >= 0) { dbei.pBlob = (BYTE *)m_jobs[iSendJobIndex].szSendBuffer; - iMsgLen = lstrlenA(m_jobs[iSendJobIndex].szSendBuffer) + 1; + iMsgLen = mir_strlen(m_jobs[iSendJobIndex].szSendBuffer) + 1; } else { iMsgLen = 0; @@ -568,7 +568,7 @@ void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const /* message area is empty, so we can recall the failed message... */ SETTEXTEX stx = {ST_DEFAULT, 1200}; if (m_jobs[iEntry].dwFlags & PREF_UNICODE) - SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)&m_jobs[iEntry].szSendBuffer[lstrlenA(m_jobs[iEntry].szSendBuffer) + 1]); + SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)&m_jobs[iEntry].szSendBuffer[mir_strlen(m_jobs[iEntry].szSendBuffer) + 1]); else { stx.codepage = (m_jobs[iEntry].dwFlags & PREF_UTF) ? CP_UTF8 : CP_ACP; SendDlgItemMessage(dat->hwnd, IDC_MESSAGE, EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)m_jobs[iEntry].szSendBuffer); @@ -618,8 +618,8 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) POPUPDATAT ppd = { 0 }; ppd.lchContact = dat->hContact; - lstrcpyn(ppd.lptzContactName, dat->cache->getNick(), MAX_CONTACTNAME); - lstrcpyn(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), MAX_SECONDLINE); + mir_tstrncpy(ppd.lptzContactName, dat->cache->getNick(), MAX_CONTACTNAME); + mir_tstrncpy(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), MAX_SECONDLINE); if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) { ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT); @@ -641,7 +641,7 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat) int SendQueue::RTL_Detect(const WCHAR *pszwText) { int i, n = 0; - int iLen = lstrlenW(pszwText); + int iLen = mir_wstrlen(pszwText); WORD *infoTypeC2 = (WORD *)mir_alloc(sizeof(WORD) * (iLen + 2)); if (infoTypeC2) { @@ -712,7 +712,7 @@ inform_and_discard: dbei.flags = DBEF_SENT; dbei.szModule = GetContactProto(job.hContact); dbei.timestamp = time(NULL); - dbei.cbBlob = lstrlenA(job.szSendBuffer) + 1; + dbei.cbBlob = mir_strlen(job.szSendBuffer) + 1; if (dat) dat->cache->updateStats(TSessionStats::BYTES_SENT, dbei.cbBlob - 1); @@ -810,7 +810,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b dbei.flags = DBEF_SENT | DBEF_UTF; dbei.szModule = GetContactProto(dat->hContact); dbei.timestamp = time(NULL); - dbei.cbBlob = lstrlenA(utfText) + 1; + dbei.cbBlob = mir_strlen(utfText) + 1; dbei.pBlob = (PBYTE) utfText; StreamInEvents(dat->hwnd, 0, 1, 1, &dbei); if (dat->hDbEventFirst == NULL) @@ -845,7 +845,7 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b if (job->dwFlags & PREF_UTF || !(job->dwFlags & PREF_UNICODE)) { char *utf_header = mir_utf8encodeT(tszHeader); - UINT required = lstrlenA(utf_header) + lstrlenA(job->szSendBuffer) + 10; + UINT required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10; char *tszMsg = reinterpret_cast<char *>(mir_alloc(required)); if (fIsSendLater) { @@ -860,10 +860,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b mir_free(tszMsg); } else if (job->dwFlags & PREF_UNICODE) { - int iLen = lstrlenA(job->szSendBuffer); + int iLen = mir_strlen(job->szSendBuffer); wchar_t *wszMsg = (wchar_t *)&job->szSendBuffer[iLen + 1]; - UINT required = sizeof(TCHAR) * (lstrlen(tszHeader) + lstrlenW(wszMsg) + 10); + UINT required = sizeof(TCHAR) * (mir_tstrlen(tszHeader) + mir_wstrlen(wszMsg) + 10); TCHAR *tszMsg = reinterpret_cast<TCHAR *>(mir_alloc(required)); if (fIsSendLater) diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index b55e905536..834cc122b5 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -148,7 +148,7 @@ const SIZE& CSideBarButton::measureItem() HFONT oldFont = reinterpret_cast<HFONT>(::SelectObject(dc, ::GetStockObject(DEFAULT_GUI_FONT)));
mir_sntprintf(tszLabel, 255, _T("%s"), m_dat->newtitle);
- ::GetTextExtentPoint32(dc, tszLabel, lstrlen(tszLabel), &sz);
+ ::GetTextExtentPoint32(dc, tszLabel, mir_tstrlen(tszLabel), &sz);
sz.cx += 28;
if (m_dat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON)
@@ -1180,9 +1180,9 @@ const SIZE& __fastcall CSideBar::m_measureAdvancedVertical(CSideBarButton* item) HDC dc = ::GetDC(dat->hwnd);
HFONT hOldFont = reinterpret_cast<HFONT>(::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_NICK]));
- ::GetTextExtentPoint32(dc, dat->cache->getNick(), lstrlen(dat->cache->getNick()), &szFirstLine);
+ ::GetTextExtentPoint32(dc, dat->cache->getNick(), mir_tstrlen(dat->cache->getNick()), &szFirstLine);
::SelectObject(dc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS]);
- ::GetTextExtentPoint32(dc, dat->szStatus, lstrlen(dat->szStatus), &szSecondLine);
+ ::GetTextExtentPoint32(dc, dat->szStatus, mir_tstrlen(dat->szStatus), &szSecondLine);
::SelectObject(dc, hOldFont);
ReleaseDC(dat->hwnd, dc);
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index 06fc9c878b..1c6f9e4af2 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -152,7 +152,7 @@ int _DebugTraceA(const char *fmt, ...) va_list va; va_start(va, fmt); - lstrcpyA(debug, "TABSRMM: "); + mir_strcpy(debug, "TABSRMM: "); mir_vsnprintf(&debug[9], ibsize - 10, fmt, va); #ifdef _DEBUG OutputDebugStringA(debug); diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp index 0ee0234859..62cd362119 100644 --- a/plugins/TabSRMM/src/templates.cpp +++ b/plugins/TabSRMM/src/templates.cpp @@ -336,7 +336,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP SetTextColor(dis->hDC, GetSysColor(COLOR_WINDOWTEXT)); } char *pszName = Translate(TemplateNames[iItem]); - TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, pszName, lstrlenA(pszName)); + TextOutA(dis->hDC, dis->rcItem.left, dis->rcItem.top, pszName, (int)mir_strlen(pszName)); } return TRUE; @@ -357,7 +357,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP dbei.szModule = "Sample error message"; dbei.cbSize = sizeof(dbei); dbei.pBlob = (iIndex == 6) ? (BYTE *)"is now offline (was online)" : (BYTE *)"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."; - dbei.cbBlob = lstrlenA((char *)dbei.pBlob) + 1; + dbei.cbBlob = (int)mir_strlen((char *)dbei.pBlob) + 1; dbei.flags = (iIndex == 1 || iIndex == 3 || iIndex == 5) ? DBEF_SENT : 0; dbei.flags |= (teInfo->rtl ? DBEF_RTL : 0); dat->lastEventTime = (iIndex == 4 || iIndex == 5) ? time(NULL) - 1 : 0; diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp index 301a031f21..11a91b80d7 100644 --- a/plugins/TabSRMM/src/themeio.cpp +++ b/plugins/TabSRMM/src/themeio.cpp @@ -135,7 +135,7 @@ static void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF lf->lfQuality = DEFAULT_QUALITY;
lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT) {
- lstrcpynA(lf->lfFaceName, "Webdings", LF_FACESIZE);
+ mir_strncpy(lf->lfFaceName, "Webdings", LF_FACESIZE);
lf->lfCharSet = SYMBOL_CHARSET;
} else
GetPrivateProfileStringA(szKey, "Face", "Tahoma", lf->lfFaceName, LF_FACESIZE - 1, szIniFilename);
@@ -287,7 +287,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in mir_snprintf(szAppname, SIZEOF(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
if (GetPrivateProfileStringA(szAppname, "Face", "Verdana", szBuf, sizeof(szBuf), szIniFilename) != 0) {
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
- lstrcpynA(szBuf, "Arial", sizeof(szBuf));
+ mir_strncpy(szBuf, "Arial", sizeof(szBuf));
db_set_s(NULL, szModule, szTemp, szBuf);
}
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 7e2e4833ae..829897679a 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1408,9 +1408,9 @@ void CSkin::Load(void) GetPrivateProfileSectionNames(szSections, 3000, m_tszFileName);
szSections[3001] = szSections[3000] = 0;
TCHAR *p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
if (p[0] != '%') {
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
continue;
}
for (i = 0; i <= ID_EXTBK_LAST; i++) {
@@ -1419,7 +1419,7 @@ void CSkin::Load(void) break;
}
}
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
j++;
}
@@ -1543,7 +1543,7 @@ void CSkin::LoadItems() szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
p1 = _tcschr(p, (int)'=');
if (p1)
*p1 = 0;
@@ -1553,14 +1553,14 @@ void CSkin::LoadItems() ZeroMemory(&m_skinIcons[m_nrSkinIcons], sizeof(TIconDesc));
m_skinIcons[m_nrSkinIcons].uId = tmpIconDesc.uId;
m_skinIcons[m_nrSkinIcons].phIcon = (HICON *)(&m_skinIcons[m_nrSkinIcons].uId);
- m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (lstrlen(p) + 1));
- lstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
+ m_skinIcons[m_nrSkinIcons].szName = (TCHAR*)mir_alloc(sizeof(TCHAR) * (mir_tstrlen(p) + 1));
+ mir_tstrcpy(m_skinIcons[m_nrSkinIcons].szName, p);
m_nrSkinIcons++;
}
}
if (p1)
*p1 = '=';
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
}
ZeroMemory(szSections, (SECT_BUFFER_SIZE + 2) * sizeof(TCHAR));
@@ -1568,10 +1568,10 @@ void CSkin::LoadItems() szSections[SECT_BUFFER_SIZE] = 0;
p = szSections;
- while (lstrlen(p) > 1) {
+ while (mir_tstrlen(p) > 1) {
if (p[0] == '$')
ReadImageItem(p);
- p += (lstrlen(p) + 1);
+ p += (mir_tstrlen(p) + 1);
}
nextButtonID = IDC_TBFIRSTUID;
@@ -1672,7 +1672,7 @@ void CSkin::setupAeroSkins() TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
_tcsncpy_s(tszBasePath, M.getDataPath(), _TRUNCATE);
- if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
// load unknown avatar..
@@ -2443,7 +2443,7 @@ void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const {
TCHAR tszBasePath[MAX_PATH];
mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M.getDataPath());
- if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
+ if (tszBasePath[mir_tstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
CreateDirectoryTreeT(tszBasePath);
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp index c495de5f87..51ed8267fb 100644 --- a/plugins/TabSRMM/src/trayicon.cpp +++ b/plugins/TabSRMM/src/trayicon.cpp @@ -308,7 +308,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con if (!mode) {
mii.fMask |= MIIM_STRING;
mii.dwTypeData = (LPTSTR)szMenuEntry;
- mii.cch = lstrlen(szMenuEntry) + 1;
+ mii.cch = mir_tstrlen(szMenuEntry) + 1;
}
mii.hbmpItem = HBMMENU_CALLBACK;
mii.dwItemData = (ULONG_PTR)hIcon;
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 2a697ce0c5..51a6d33086 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -115,16 +115,16 @@ void TN_TypingMessage(MCONTACT hContact, int iMode) if (iMode == PROTOTYPE_CONTACTTYPING_OFF) {
if (StopDisabled)
return;
- lstrcpyn(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, szStop, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, szStop, MAX_SECONDLINE);
ppd.hNotification = hntfStopped;
notyping = 1;
}
else {
if (StartDisabled)
return;
- lstrcpyn(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
- lstrcpyn(ppd.lptzText, szStart, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lptzContactName, szContactName, MAX_CONTACTNAME);
+ mir_tstrncpy(ppd.lptzText, szStart, MAX_SECONDLINE);
ppd.hNotification = hntfStarted;
notyping = 0;
}
@@ -307,13 +307,13 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA for (i=0; i < 2; i++) {
int notyping;
if (i == PROTOTYPE_CONTACTTYPING_OFF) {
- lstrcpy(ppd.lptzContactName, TranslateT("Contact"));
- lstrcpyn(ppd.lptzText, szStop, MAX_SECONDLINE);
+ mir_tstrcpy(ppd.lptzContactName, TranslateT("Contact"));
+ mir_tstrncpy(ppd.lptzText, szStop, MAX_SECONDLINE);
notyping = 1;
}
else {
- lstrcpy(ppd.lptzContactName, TranslateT("Contact"));
- lstrcpyn(ppd.lptzText, szStart, MAX_SECONDLINE);
+ mir_tstrcpy(ppd.lptzContactName, TranslateT("Contact"));
+ mir_tstrncpy(ppd.lptzText, szStart, MAX_SECONDLINE);
notyping = 0;
}
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 62c99da38c..511614cd6d 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -81,7 +81,7 @@ TCHAR* Utils::FilterEventMarkers(TCHAR *wszText) break;
}
- lstrcpy(wszText, text.c_str());
+ mir_tstrcpy(wszText, text.c_str());
return wszText;
}
@@ -126,8 +126,8 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO search_again:
bool clr_found = false;
for (int ii = 0; ii < rtf_ctable_size; ii++) {
- if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, lstrlen(rtf_ctable[ii].szName))) {
- closing = beginmark + 7 + lstrlen(rtf_ctable[ii].szName);
+ if (!_tcsnicmp((TCHAR*)colorname.c_str(), rtf_ctable[ii].szName, mir_tstrlen(rtf_ctable[ii].szName))) {
+ closing = beginmark + 7 + mir_tstrlen(rtf_ctable[ii].szName);
if (endmark != message.npos) {
message.erase(endmark, 4);
message.replace(endmark, 4, _T("c0 "));
@@ -286,7 +286,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (tszNick[0])
title.insert(tempmark + 2, tszNick);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(tszNick);
+ curpos = tempmark + mir_tstrlen(tszNick);
break;
}
case 'p':
@@ -295,14 +295,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (szAcc)
title.insert(tempmark + 2, szAcc);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(szAcc);
+ curpos = tempmark + mir_tstrlen(szAcc);
break;
}
case 's': {
if (dat->szStatus && dat->szStatus[0])
title.insert(tempmark + 2, dat->szStatus);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(dat->szStatus);
+ curpos = tempmark + mir_tstrlen(dat->szStatus);
break;
}
case 'u': {
@@ -310,14 +310,14 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (szUIN[0])
title.insert(tempmark + 2, szUIN);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(szUIN);
+ curpos = tempmark + mir_tstrlen(szUIN);
break;
}
case 'c': {
TCHAR *c = (!_tcscmp(dat->pContainer->szName, _T("default")) ? TranslateT("Default container") : dat->pContainer->szName);
title.insert(tempmark + 2, c);
title.erase(tempmark, 2);
- curpos = tempmark + lstrlen(c);
+ curpos = tempmark + mir_tstrlen(c);
break;
}
case 'o': {
@@ -325,7 +325,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (szProto)
title.insert(tempmark + 2, _A2T(szProto));
title.erase(tempmark, 2);
- curpos = tempmark + (szProto ? lstrlenA(szProto) : 0);
+ curpos = tempmark + (szProto ? mir_strlen(szProto) : 0);
break;
}
case 'x': {
@@ -340,11 +340,11 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat szTemp[500] = 0;
db_free(&dbv);
title.insert(tempmark + 2, szTemp);
- curpos = tempmark + lstrlen(szTemp);
+ curpos = tempmark + mir_tstrlen(szTemp);
}
else {
title.insert(tempmark + 2, xStatusDescr[xStatus - 1]);
- curpos = tempmark + lstrlen(xStatusDescr[xStatus - 1]);
+ curpos = tempmark + mir_tstrlen(xStatusDescr[xStatus - 1]);
}
}
title.erase(tempmark, 2);
@@ -368,7 +368,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat if (szFinalStatus) {
title.insert(tempmark + 2, szFinalStatus);
- curpos = tempmark + lstrlen(szFinalStatus);
+ curpos = tempmark + mir_tstrlen(szFinalStatus);
}
title.erase(tempmark, 2);
@@ -381,12 +381,12 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat TCHAR *tszStatusMsg = dat->cache->getNormalizedStatusMsg(dat->cache->getStatusMsg(), true);
if (tszStatusMsg) {
title.insert(tempmark + 2, tszStatusMsg);
- curpos = tempmark + lstrlen(tszStatusMsg);
+ curpos = tempmark + mir_tstrlen(tszStatusMsg);
}
else if (title[curpos] == 't') {
const TCHAR* tszStatusMsg = TranslateT("No status message");
title.insert(tempmark + 2, tszStatusMsg);
- curpos = tempmark + lstrlen(tszStatusMsg);
+ curpos = tempmark + mir_tstrlen(tszStatusMsg);
}
title.erase(tempmark, 2);
if (tszStatusMsg)
@@ -437,7 +437,7 @@ char* Utils::FilterEventMarkers(char *szText) break;
}
//
- lstrcpyA(szText, text.c_str());
+ mir_strcpy(szText, text.c_str());
return szText;
}
@@ -707,7 +707,7 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
mir_snprintf(szCName, 40, "%s%d_theme", szSetting, pContainer->iContainerIndex);
- if (lstrlen(pContainer->szRelThemeFile) > 1) {
+ if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
@@ -852,7 +852,7 @@ void Utils::addMenuItem(const HMENU& m, MENUITEMINFO& mii, HICON hIcon, const TC mii.wID = uID;
mii.dwItemData = (ULONG_PTR)hIcon;
mii.dwTypeData = const_cast<TCHAR *>(szText);
- mii.cch = lstrlen(mii.dwTypeData) + 1;
+ mii.cch = mir_tstrlen(mii.dwTypeData) + 1;
::InsertMenuItem(m, pos, TRUE, &mii);
}
@@ -1018,7 +1018,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename) {
static wchar_t *forbiddenCharacters = L"%/\\':|\"<>?";
- for (int i=0; i < lstrlenW(forbiddenCharacters); i++) {
+ for (int i=0; i < mir_wstrlen(forbiddenCharacters); i++) {
wchar_t* szFound = 0;
while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != NULL)
@@ -1032,7 +1032,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename) void Utils::ensureTralingBackslash(wchar_t *szPathname)
{
- if (szPathname[lstrlenW(szPathname) - 1] != '\\')
+ if (szPathname[mir_wstrlen(szPathname) - 1] != '\\')
wcscat(szPathname, L"\\");
}
@@ -1052,7 +1052,7 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename) if (wcslen(sysPathName) + wcslen(szFilename) >= MAX_PATH)
return 0;
- lstrcatW(sysPathName, szFilename);
+ mir_wstrcat(sysPathName, szFilename);
HMODULE _h = LoadLibraryW(sysPathName);
if (0 == _h)
return 0;
@@ -1077,7 +1077,7 @@ size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner) if (!OpenClipboard(hwndOwner) || str == 0)
return 0;
- size_t i = sizeof(TCHAR) * (lstrlen(str) + 1);
+ size_t i = sizeof(TCHAR) * (mir_tstrlen(str) + 1);
EmptyClipboard();
HGLOBAL hData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, i);
@@ -1102,15 +1102,15 @@ void Utils::AddToFileList(TCHAR ***pppFiles, int *totalCount, LPCTSTR szFilename WIN32_FIND_DATA fd;
HANDLE hFind;
TCHAR szPath[MAX_PATH];
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\*"));
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\*"));
if ((hFind = FindFirstFile(szPath, &fd)) != INVALID_HANDLE_VALUE) {
do {
if (!lstrcmp(fd.cFileName, _T(".")) || !lstrcmp(fd.cFileName, _T("..")))
continue;
- lstrcpy(szPath, szFilename);
- lstrcat(szPath, _T("\\"));
- lstrcat(szPath, fd.cFileName);
+ mir_tstrcpy(szPath, szFilename);
+ mir_tstrcat(szPath, _T("\\"));
+ mir_tstrcat(szPath, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
}
while (FindNextFile(hFind, &fd));
|