summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-11-30 18:51:36 +0000
commit688f55ba998c19304a29727c910504903f4cc49a (patch)
tree69121ebb6d02bcf9e670428b11813087fc7f1640 /src/core
parent4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff)
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdauth/authdialogs.cpp2
-rw-r--r--src/core/stdaway/sendmsg.cpp10
-rw-r--r--src/core/stdchat/src/log.cpp2
-rw-r--r--src/core/stdchat/src/options.cpp4
-rw-r--r--src/core/stdchat/src/tools.cpp8
-rw-r--r--src/core/stdchat/src/window.cpp26
-rw-r--r--src/core/stdclist/src/clcpaint.cpp16
-rw-r--r--src/core/stdemail/email.cpp6
-rw-r--r--src/core/stdfile/file.cpp8
-rw-r--r--src/core/stdfile/fileexistsdlg.cpp8
-rw-r--r--src/core/stdfile/filerecvdlg.cpp14
-rw-r--r--src/core/stdfile/filesenddlg.cpp20
-rw-r--r--src/core/stdfile/filexferdlg.cpp16
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgoptions.cpp2
-rw-r--r--src/core/stduihist/history.cpp4
-rw-r--r--src/core/stdurl/urldialogs.cpp14
-rw-r--r--src/core/stduserinfo/contactinfo.cpp24
-rw-r--r--src/core/stduserinfo/stdinfo.cpp4
19 files changed, 96 insertions, 96 deletions
diff --git a/src/core/stdauth/authdialogs.cpp b/src/core/stdauth/authdialogs.cpp
index e8894a8aa6..99000a8663 100644
--- a/src/core/stdauth/authdialogs.cpp
+++ b/src/core/stdauth/authdialogs.cpp
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcAuthReq(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
off = mir_sntprintf(name, SIZEOF(name), _T("%s"), (TCHAR*)firstT);
else if (lastT[0])
off = mir_sntprintf(name, SIZEOF(name), _T("%s"), (TCHAR*)lastT);
- if (lstrlen(nickT)) {
+ if (mir_tstrlen(nickT)) {
if (off)
mir_sntprintf(name + off, SIZEOF(name) - off, _T(" (%s)"), (TCHAR*)nickT);
else
diff --git a/src/core/stdaway/sendmsg.cpp b/src/core/stdaway/sendmsg.cpp
index d3ee3ea38e..53273ab9a6 100644
--- a/src/core/stdaway/sendmsg.cpp
+++ b/src/core/stdaway/sendmsg.cpp
@@ -131,10 +131,10 @@ static TCHAR* GetAwayMessage(int statusMode, char *szProto)
GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, substituteStr, SIZEOF(substituteStr));
else continue;
- if (lstrlen(substituteStr) > 6)
- dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (lstrlen(dbv.ptszVal) + 1 + lstrlen(substituteStr) - 6) * sizeof(TCHAR));
- MoveMemory(dbv.ptszVal + i + lstrlen(substituteStr), dbv.ptszVal + i + 6, (lstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
- CopyMemory(dbv.ptszVal+i, substituteStr, lstrlen(substituteStr) * sizeof(TCHAR));
+ if (mir_tstrlen(substituteStr) > 6)
+ dbv.ptszVal = (TCHAR*)mir_realloc(dbv.ptszVal, (mir_tstrlen(dbv.ptszVal) + 1 + mir_tstrlen(substituteStr) - 6) * sizeof(TCHAR));
+ MoveMemory(dbv.ptszVal + i + mir_tstrlen(substituteStr), dbv.ptszVal + i + 6, (mir_tstrlen(dbv.ptszVal) - i - 5) * sizeof(TCHAR));
+ CopyMemory(dbv.ptszVal+i, substituteStr, mir_tstrlen(substituteStr) * sizeof(TCHAR));
}
}
return dbv.ptszVal;
@@ -408,7 +408,7 @@ static INT_PTR CALLBACK DlgProcAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Default"), &dbv))
if (db_get_ts(NULL, "SRAway", StatusModeToDbSetting(statusModes[i], "Msg"), &dbv))
dbv.ptszVal = mir_tstrdup(GetDefaultMessage(statusModes[i]));
- lstrcpy(dat->info[j].msg, dbv.ptszVal);
+ mir_tstrcpy(dat->info[j].msg, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
if (hLst)
diff --git a/src/core/stdchat/src/log.cpp b/src/core/stdchat/src/log.cpp
index 0e5a94edb5..458183baf6 100644
--- a/src/core/stdchat/src/log.cpp
+++ b/src/core/stdchat/src/log.cpp
@@ -31,7 +31,7 @@ static DWORD CALLBACK Log_StreamCallback(DWORD_PTR dwCookie, LPBYTE pbBuff, LONG
if (lstrdat->buffer == NULL) {
lstrdat->bufferOffset = 0;
lstrdat->buffer = pci->Log_CreateRTF(lstrdat);
- lstrdat->bufferLen = lstrlenA(lstrdat->buffer);
+ lstrdat->bufferLen = mir_strlen(lstrdat->buffer);
}
// give the RTF to the RE control
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index 20fa87ee44..e7dbb03ab0 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -534,9 +534,9 @@ static INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPA
LPITEMIDLIST idList = SHBrowseForFolder(&bi);
if (idList) {
SHGetPathFromIDList(idList, szDirectory);
- lstrcat(szDirectory, _T("\\"));
+ mir_tstrcat(szDirectory, _T("\\"));
PathToRelativeT(szDirectory, szTemp);
- SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, lstrlen(szTemp) > 1 ? szTemp : _T("Logs\\"));
+ SetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, mir_tstrlen(szTemp) > 1 ? szTemp : _T("Logs\\"));
CoTaskMemFree(idList);
}
}
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp
index 81d154ce41..61f4679a40 100644
--- a/src/core/stdchat/src/tools.cpp
+++ b/src/core/stdchat/src/tools.cpp
@@ -53,7 +53,7 @@ bool LoadMessageFont(LOGFONT *lf, COLORREF *colour)
if (db_get_ts(NULL, "SRMM", str, &dbv))
_tcscpy(lf->lfFaceName, _T("Arial"));
else {
- lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
@@ -146,10 +146,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)
- lstrcpy(szTemp + 40, _T("..."));
+ if (mir_tstrlen(szTemp) > 40)
+ mir_tstrcpy(szTemp + 40, _T("..."));
ModifyMenu(*hMenu, ID_MESS, MF_STRING | MF_BYCOMMAND, ID_MESS, szTemp);
gcmi.Type = MENU_ON_NICKLIST;
}
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index b14db35b51..15d1e0e6d8 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -393,10 +393,10 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
end ++;
if ( dat->szTabSave[0] =='\0')
- lstrcpyn( dat->szTabSave, pszText+start, end-start+1 );
+ mir_tstrncpy( dat->szTabSave, pszText+start, end-start+1 );
pszSelName = (TCHAR *)mir_alloc( sizeof(TCHAR)*( end-start+1 ));
- lstrcpyn( pszSelName, pszText+start, end-start+1);
+ mir_tstrncpy( pszSelName, pszText+start, end-start+1);
pszName = pci->UM_FindUserAutoComplete(Parentsi->pUsers, dat->szTabSave, pszSelName);
if (pszName == NULL) {
pszName = dat->szTabSave;
@@ -1543,9 +1543,9 @@ END_REMOVETAB:
int insertat;
TCHAR szTemp [30];
- lstrcpyn(szTemp, s1->ptszName, 21);
- if (lstrlen(s1->ptszName) >20)
- lstrcpyn(szTemp+20, _T("..."), 4);
+ mir_tstrncpy(szTemp, s1->ptszName, 21);
+ if (mir_tstrlen(s1->ptszName) >20)
+ mir_tstrncpy(szTemp+20, _T("..."), 4);
tci.mask = TCIF_TEXT|TCIF_PARAM ;
tci.pszText = szTemp;
@@ -1790,7 +1790,7 @@ END_REMOVETAB:
}
SetTextColor(dis->hDC, ui->iStatusEx == 0?g_Settings.crUserListColor:g_Settings.crUserListHeadingsColor);
- TextOut(dis->hDC, dis->rcItem.left+x_offset, dis->rcItem.top, ui->pszNick, lstrlen(ui->pszNick));
+ TextOut(dis->hDC, dis->rcItem.left+x_offset, dis->rcItem.top, ui->pszNick, (int)mir_tstrlen(ui->pszNick));
SelectObject(dis->hDC, hOldFont);
if (si->pAccPropServicesForNickList) {
@@ -2136,9 +2136,9 @@ LABEL_SHOWWINDOW:
tr.lpstrText = pszWord;
long iRes = SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_GETTEXTRANGE, 0, (LPARAM)&tr);
if (iRes > 0) {
- int iLen = lstrlen(pszWord) - 1;
+ int iLen = (int)mir_tstrlen(pszWord)-1;
while (iLen >= 0 && _tcschr(szTrimString, pszWord[iLen])) {
- pszWord[iLen] = _T('\0');
+ pszWord[iLen] = 0;
iLen--;
} } }
@@ -2240,8 +2240,8 @@ LABEL_SHOWWINDOW:
if (!OpenClipboard(hwndDlg))
break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(lstrlen(tr.lpstrText) + 1));
- lstrcpy(( TCHAR* )GlobalLock(hData), tr.lpstrText);
+ hData = GlobalAlloc(GMEM_MOVEABLE, sizeof(TCHAR)*(mir_tstrlen(tr.lpstrText) + 1));
+ mir_tstrcpy(( TCHAR* )GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
SetClipboardData(CF_UNICODETEXT, hData);
CloseClipboard();
@@ -2295,11 +2295,11 @@ LABEL_SHOWWINDOW:
if (GetKeyState(VK_SHIFT) & 0x8000) {
LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
- TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(lstrlen(ui->pszUID) + 3));
+ TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR)*(mir_tstrlen(ui->pszUID) + 3));
if (start == 0)
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 3, _T("%s: "), ui->pszUID);
else
- mir_sntprintf(pszName, lstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
+ mir_sntprintf(pszName, mir_tstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM)pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp
index 3bfb0597b2..d312d5ce4a 100644
--- a/src/core/stdclist/src/clcpaint.cpp
+++ b/src/core/stdclist/src/clcpaint.cpp
@@ -320,14 +320,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight);
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
+ GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, mir_tstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
width = textSize.cx;
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
if (szCounts[0]) {
GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
- GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize);
+ GetTextExtentPoint32A(hdcMem, szCounts, mir_strlen(szCounts), &countsSize);
width += spaceSize.cx + countsSize.cx;
}
}
@@ -424,7 +424,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
rc.left = rc.right + 6 + textSize.cx;
rc.right = clRect.right;
DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
@@ -440,7 +440,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
if (rc.right < rc.left + 4)
rc.right = clRect.right + 1;
else
- TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts));
+ TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, mir_strlen(szCounts));
ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
if (selected)
SetTextColor(hdcMem, dat->selTextColour);
@@ -448,12 +448,12 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
SetHotTrackColour(hdcMem, dat);
rc.right--;
ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText), NULL);
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText), NULL);
}
else
TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace,
y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
- lstrlen(group->cl.items[group->scanIndex]->szText));
+ mir_tstrlen(group->cl.items[group->scanIndex]->szText));
if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
rc.top = y + (dat->rowHeight >> 1);
rc.bottom = rc.top + 2;
@@ -470,14 +470,14 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
rc.right = (clRect.right - clRect.left);
rc.bottom = rc.top;
- DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ DrawText(hdcMem, szText, mir_tstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
}
if (selected) {
if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) {
TCHAR *szText = group->cl.items[group->scanIndex]->szText;
RECT rc;
- int qlen = lstrlen(dat->szQuickSearch);
+ int qlen = mir_tstrlen(dat->szQuickSearch);
SetTextColor(hdcMem, dat->quickSearchColour);
rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
diff --git a/src/core/stdemail/email.cpp b/src/core/stdemail/email.cpp
index 23ae28da48..d73786d379 100644
--- a/src/core/stdemail/email.cpp
+++ b/src/core/stdemail/email.cpp
@@ -42,9 +42,9 @@ static INT_PTR SendEMailCommand(WPARAM hContact, LPARAM lParam)
return 1;
}
}
- char *szUrl = (char*)mir_alloc(lstrlenA(dbv.pszVal)+8);
- lstrcpyA(szUrl, "mailto:");
- lstrcatA(szUrl, dbv.pszVal);
+ char *szUrl = (char*)mir_alloc(mir_strlen(dbv.pszVal)+8);
+ mir_strcpy(szUrl, "mailto:");
+ mir_strcat(szUrl, dbv.pszVal);
mir_free(dbv.pszVal);
forkthread(SendEmailThread, 0, szUrl);
return 0;
diff --git a/src/core/stdfile/file.cpp b/src/core/stdfile/file.cpp
index 004eb72ccd..5e5b32da4d 100644
--- a/src/core/stdfile/file.cpp
+++ b/src/core/stdfile/file.cpp
@@ -98,7 +98,7 @@ static INT_PTR GetReceivedFilesFolder(WPARAM wParam, LPARAM lParam)
TCHAR buf[MAX_PATH];
GetContactReceivedFilesDir(wParam, buf, MAX_PATH, TRUE);
char* dir = mir_t2a(buf);
- lstrcpynA((char*)lParam, dir, MAX_PATH);
+ mir_strncpy((char*)lParam, dir, MAX_PATH);
mir_free(dir);
return 0;
}
@@ -358,9 +358,9 @@ static void sttRecvCreateBlob(DBEVENTINFO &dbei, int fileCount, char **pszFiles,
dbei.cbBlob = sizeof(DWORD);
for (int i = 0; i < fileCount; i++)
- dbei.cbBlob += lstrlenA(pszFiles[i]) + 1;
+ dbei.cbBlob += mir_strlen(pszFiles[i]) + 1;
- dbei.cbBlob += lstrlenA(szDescr) + 1;
+ dbei.cbBlob += mir_strlen(szDescr) + 1;
if ((dbei.pBlob = (BYTE*)mir_alloc(dbei.cbBlob)) == 0)
return;
@@ -369,7 +369,7 @@ static void sttRecvCreateBlob(DBEVENTINFO &dbei, int fileCount, char **pszFiles,
BYTE* p = dbei.pBlob + sizeof(DWORD);
for (int i = 0; i < fileCount; i++) {
strcpy((char*)p, pszFiles[i]);
- p += lstrlenA(pszFiles[i]) + 1;
+ p += mir_strlen(pszFiles[i]) + 1;
}
strcpy((char*)p, (szDescr == NULL) ? "" : szDescr);
}
diff --git a/src/core/stdfile/fileexistsdlg.cpp b/src/core/stdfile/fileexistsdlg.cpp
index 1e604c2947..4bf7da405a 100644
--- a/src/core/stdfile/fileexistsdlg.cpp
+++ b/src/core/stdfile/fileexistsdlg.cpp
@@ -149,7 +149,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
TCHAR *pszExtension = _tcsrchr(pszFilename, '.');
if (pszExtension)
- lstrcpyn(szExtension, pszExtension + 1, SIZEOF(szExtension));
+ mir_tstrncpy(szExtension, pszExtension + 1, SIZEOF(szExtension));
else {
pszExtension = _T(".");
szExtension[0] = '\0';
@@ -166,7 +166,7 @@ void __cdecl LoadIconsAndTypesThread(void* param)
else {
TCHAR szTypeName[MAX_PATH];
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, pszExtension, NULL, szTypeName, SIZEOF(szTypeName))) {
- lstrcat(szTypeName, _T("\\DefaultIcon"));
+ mir_tstrcat(szTypeName, _T("\\DefaultIcon"));
if (SRFile_GetRegValue(HKEY_CLASSES_ROOT, szTypeName, NULL, szIconFile, SIZEOF(szIconFile))) {
if (_tcsstr(szIconFile, _T("%1")))
SRFile_GetRegValue(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Icons"), _T("0"), szIconFile, SIZEOF(szIconFile));
@@ -244,7 +244,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case IDC_OPENFOLDER:
{
TCHAR szFile[MAX_PATH];
- lstrcpyn(szFile, fts->tszCurrentFile, SIZEOF(szFile));
+ mir_tstrncpy(szFile, fts->tszCurrentFile, SIZEOF(szFile));
TCHAR *pszLastBackslash = _tcsrchr(szFile, '\\');
if (pszLastBackslash)
*pszLastBackslash = '\0';
@@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TCHAR filter[512], *pfilter;
TCHAR str[MAX_PATH];
- lstrcpyn(str, fts->tszCurrentFile, SIZEOF(str));
+ mir_tstrncpy(str, fts->tszCurrentFile, SIZEOF(str));
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY;
diff --git a/src/core/stdfile/filerecvdlg.cpp b/src/core/stdfile/filerecvdlg.cpp
index 68e84dcf73..9509e14dda 100644
--- a/src/core/stdfile/filerecvdlg.cpp
+++ b/src/core/stdfile/filerecvdlg.cpp
@@ -38,7 +38,7 @@ static void GetLowestExistingDirName(const TCHAR *szTestDir, TCHAR *szExistingDi
DWORD dwAttributes;
TCHAR *pszLastBackslash;
- lstrcpyn(szExistingDir, szTestDir, cchExistingDir);
+ mir_tstrncpy(szExistingDir, szTestDir, cchExistingDir);
while ((dwAttributes = GetFileAttributes(szExistingDir)) != INVALID_FILE_ATTRIBUTES && !(dwAttributes&FILE_ATTRIBUTE_DIRECTORY)) {
pszLastBackslash = _tcsrchr(szExistingDir, '\\');
if (pszLastBackslash == NULL) { *szExistingDir = '\0'; break; }
@@ -96,7 +96,7 @@ int BrowseForFolder(HWND hwnd, TCHAR *szPath)
LPITEMIDLIST pidlResult = SHBrowseForFolder(&bi);
if (pidlResult) {
SHGetPathFromIDList(pidlResult, szPath);
- lstrcat(szPath, _T("\\"));
+ mir_tstrcat(szPath, _T("\\"));
CoTaskMemFree(pidlResult);
}
return pidlResult != NULL;
@@ -123,9 +123,9 @@ static void patchDir(TCHAR *str, size_t strSize)
mir_free(result);
}
- size_t len = lstrlen(str);
+ size_t len = mir_tstrlen(str);
if (len + 1 < strSize && str[len - 1] != '\\')
- lstrcpy(str + len, _T("\\"));
+ mir_tstrcpy(str + len, _T("\\"));
}
void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOOL patchVars)
@@ -170,7 +170,7 @@ void GetContactReceivedFilesDir(MCONTACT hContact, TCHAR *szDir, int cchDir, BOO
if (patchVars)
patchDir(tszTemp, SIZEOF(tszTemp));
RemoveInvalidPathChars(tszTemp);
- lstrcpyn(szDir, tszTemp, cchDir);
+ mir_tstrncpy(szDir, tszTemp, cchDir);
}
void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
@@ -185,7 +185,7 @@ void GetReceivedFilesDir(TCHAR *szDir, int cchDir)
patchDir(tszTemp, SIZEOF(tszTemp));
RemoveInvalidPathChars(tszTemp);
- lstrcpyn(szDir, tszTemp, cchDir);
+ mir_tstrncpy(szDir, tszTemp, cchDir);
}
INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -341,7 +341,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
GetDlgItemText(hwndDlg, IDC_FILEDIR, szRecvDir, SIZEOF(szRecvDir));
RemoveInvalidPathChars(szRecvDir);
GetContactReceivedFilesDir(NULL, szDefaultRecvDir, SIZEOF(szDefaultRecvDir), TRUE);
- if (_tcsnicmp(szRecvDir, szDefaultRecvDir, lstrlen(szDefaultRecvDir))) {
+ if (_tcsnicmp(szRecvDir, szDefaultRecvDir, mir_tstrlen(szDefaultRecvDir))) {
char idstr[32];
int i;
DBVARIANT dbv;
diff --git a/src/core/stdfile/filesenddlg.cpp b/src/core/stdfile/filesenddlg.cpp
index b6fdfe2ec4..c207cb9ff0 100644
--- a/src/core/stdfile/filesenddlg.cpp
+++ b/src/core/stdfile/filesenddlg.cpp
@@ -53,11 +53,11 @@ static void SetFileListAndSizeControls(HWND hwndDlg, FileDlgData *dat)
mir_sntprintf(str, SIZEOF(str), szFormat, fileCount, dirCount);
}
else if (fileCount) {
- lstrcpy(szFormat, TranslateT("%d files"));
+ mir_tstrcpy(szFormat, TranslateT("%d files"));
mir_sntprintf(str, SIZEOF(str), szFormat, fileCount);
}
else {
- lstrcpy(szFormat, TranslateT("%d directories"));
+ mir_tstrcpy(szFormat, TranslateT("%d directories"));
mir_sntprintf(str, SIZEOF(str), szFormat, dirCount);
}
SetDlgItemText(hwndDlg, IDC_FILE, str);
@@ -88,12 +88,12 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
// NULL separated list of all files
// fileOffset is the offset to the first file.
- fileOffset = lstrlen(buf) + 1;
+ fileOffset = mir_tstrlen(buf) + 1;
// Count number of files
pBuf = buf + fileOffset;
while (*pBuf) {
- pBuf += lstrlen(pBuf) + 1;
+ pBuf += mir_tstrlen(pBuf) + 1;
nNumberOfFiles++;
}
@@ -106,7 +106,7 @@ static void FilenameToFileList(HWND hwndDlg, FileDlgData* dat, const TCHAR *buf)
nTemp = 0;
while (*pBuf) {
// Allocate space for path+filename
- int cbFileNameLen = lstrlen(pBuf);
+ int cbFileNameLen = mir_tstrlen(pBuf);
dat->files[nTemp] = (TCHAR*)mir_alloc(sizeof(TCHAR)*(fileOffset + cbFileNameLen + 1));
// Add path to filename and copy into array
@@ -147,11 +147,11 @@ void __cdecl ChooseFilesThread(void* param)
}
TCHAR filter[128];
- lstrcpy(filter, TranslateT("All files"));
- lstrcat(filter, _T(" (*)"));
- TCHAR *pfilter = filter + lstrlen(filter) + 1;
- lstrcpy(pfilter, _T("*"));
- pfilter = filter + lstrlen(filter) + 1;
+ mir_tstrcpy(filter, TranslateT("All files"));
+ mir_tstrcat(filter, _T(" (*)"));
+ TCHAR *pfilter = filter + mir_tstrlen(filter) + 1;
+ mir_tstrcpy(pfilter, _T("*"));
+ pfilter = filter + mir_tstrlen(filter) + 1;
pfilter[0] = '\0';
OPENFILENAME ofn = { 0 };
diff --git a/src/core/stdfile/filexferdlg.cpp b/src/core/stdfile/filexferdlg.cpp
index 18c8e3b5a4..f5eeeec531 100644
--- a/src/core/stdfile/filexferdlg.cpp
+++ b/src/core/stdfile/filexferdlg.cpp
@@ -85,11 +85,11 @@ void FillSendData(FileDlgData *dat, DBEVENTINFO& dbei)
char *szFileNames = Utf8EncodeT(dat->szFilenames), *szMsg = Utf8EncodeT(dat->szMsg);
dbei.flags |= DBEF_UTF;
- dbei.cbBlob = sizeof(DWORD) + lstrlenA(szFileNames) + lstrlenA(szMsg) + 2;
+ dbei.cbBlob = sizeof(DWORD) + mir_strlen(szFileNames) + mir_strlen(szMsg) + 2;
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
*(PDWORD)dbei.pBlob = 0;
- lstrcpyA((char*)dbei.pBlob + sizeof(DWORD), szFileNames);
- lstrcpyA((char*)dbei.pBlob + sizeof(DWORD) + lstrlenA(szFileNames) + 1, szMsg);
+ mir_strcpy((char*)dbei.pBlob + sizeof(DWORD), szFileNames);
+ mir_strcpy((char*)dbei.pBlob + sizeof(DWORD) + mir_strlen(szFileNames) + 1, szMsg);
mir_free(szFileNames), mir_free(szMsg);
}
@@ -109,7 +109,7 @@ static void __cdecl RunVirusScannerThread(struct virusscanthreadstartinfo *info)
*pszReplace = 0;
mir_sntprintf(szCmdLine, SIZEOF(szCmdLine), _T("%s\"%s\"%s"), dbv.ptszVal, info->szFile, pszReplace + 2);
}
- else lstrcpyn(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
+ else mir_tstrncpy(szCmdLine, dbv.ptszVal, SIZEOF(szCmdLine));
PROCESS_INFORMATION pi;
if (CreateProcess(NULL, szCmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) {
@@ -155,7 +155,7 @@ static void SetFilenameControls(HWND hwndDlg, FileDlgData *dat, PROTOFILETRANSFE
dat->hIcon = shfi.hIcon;
}
else {
- lstrcpyn(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg));
+ mir_tstrncpy(msg, pcli->pfnGetContactDisplayName(fts->hContact, 0), SIZEOF(msg));
HICON hIcon = LoadSkinIcon(SKINICON_OTHER_DOWNARROW);
dat->hIcon = CopyIcon(hIcon);
IcoLib_ReleaseIcon(hIcon, NULL);
@@ -310,7 +310,7 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
GetSensiblyFormattedSize((dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]) / dat->bytesRecvedHistorySize, szSpeed, SIZEOF(szSpeed), 0, 1, NULL);
if (dat->bytesRecvedHistory[0] == dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1])
- lstrcpy(szTime, _T("??:??:??"));
+ mir_tstrcpy(szTime, _T("??:??:??"));
else {
li.QuadPart = BIGI(10000000)*(dat->transferStatus.currentFileSize - dat->transferStatus.currentFileProgress)*dat->bytesRecvedHistorySize / (dat->bytesRecvedHistory[0] - dat->bytesRecvedHistory[dat->bytesRecvedHistorySize - 1]);
ft.dwHighDateTime = li.HighPart; ft.dwLowDateTime = li.LowPart;
@@ -477,9 +477,9 @@ INT_PTR CALLBACK DlgProcFileTransfer(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
TCHAR *pszExtension, *pszFilename;
if ((pszFilename = _tcsrchr(szOriginalFilename, '\\')) == NULL) pszFilename = szOriginalFilename;
- if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + lstrlen(pszFilename);
+ if ((pszExtension = _tcsrchr(pszFilename + 1, '.')) == NULL) pszExtension = pszFilename + mir_tstrlen(pszFilename);
if (pfr->szFilename) mir_free((TCHAR*)pfr->szFilename);
- size_t size = (pszExtension - szOriginalFilename) + 21 + lstrlen(pszExtension);
+ size_t size = (pszExtension - szOriginalFilename) + 21 + mir_tstrlen(pszExtension);
pfr->szFilename = (TCHAR*)mir_alloc(sizeof(TCHAR)*size);
for (int i = 1;; i++) {
mir_sntprintf((TCHAR*)pfr->szFilename, size, _T("%.*s (%u)%s"), pszExtension - szOriginalFilename, szOriginalFilename, i, pszExtension);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 386d1af01c..50e3f35dc7 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -550,7 +550,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
HFONT hFont = (HFONT)SelectObject(hdc, (HFONT)SendMessage(GetDlgItem(hwndDlg, IDOK), WM_GETFONT, 0, 0));
SIZE textSize;
- GetTextExtentPoint32(hdc, buf, lstrlen(buf), &textSize);
+ GetTextExtentPoint32(hdc, buf, (int)mir_tstrlen(buf), &textSize);
urc->rcItem.right = urc->rcItem.left + textSize.cx + 10;
if ((g_dat.flags&SMF_SHOWBTNS) && urc->rcItem.right > urc->dlgNewSize.cx - dat->nLabelRight)
urc->rcItem.right = urc->dlgNewSize.cx - dat->nLabelRight;
@@ -1144,7 +1144,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
}
else
- lstrcpyn(newtitle, TranslateT("Message session"), SIZEOF(newtitle));
+ mir_tstrncpy(newtitle, TranslateT("Message session"), SIZEOF(newtitle));
TCHAR oldtitle[256];
GetWindowText(hwndDlg, oldtitle, SIZEOF(oldtitle));
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp
index 1ed478bc73..6e37f4ab40 100644
--- a/src/core/stdmsg/src/msgoptions.cpp
+++ b/src/core/stdmsg/src/msgoptions.cpp
@@ -84,7 +84,7 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
if (db_get_ts(NULL, SRMMMOD, str, &dbv))
_tcscpy(lf->lfFaceName, fontOptionsList[i].szDefFace);
else {
- lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
+ mir_tstrncpy(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
db_free(&dbv);
}
mir_snprintf(str, SIZEOF(str), "SRMFont%dSet", i);
diff --git a/src/core/stduihist/history.cpp b/src/core/stduihist/history.cpp
index e6c97c1ade..96de2a056e 100644
--- a/src/core/stduihist/history.cpp
+++ b/src/core/stduihist/history.cpp
@@ -326,7 +326,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCHAR str[1024];
GetObjectDescription(&dbei, str, SIZEOF(str));
if (str[0]) {
- CharUpperBuff(str, lstrlen(str));
+ CharUpperBuff(str, mir_tstrlen(str));
if (_tcsstr(str, (const TCHAR*)lParam) != NULL) {
SendDlgItemMessage(hwndDlg, IDC_LIST, LB_SETCURSEL, index, 0);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_LIST, LBN_SELCHANGE), 0);
@@ -355,7 +355,7 @@ static INT_PTR CALLBACK DlgProcHistoryFind(HWND hwndDlg, UINT msg, WPARAM wParam
TCHAR str[128];
HWND hwndParent = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
GetDlgItemText(hwndDlg, IDC_FINDWHAT, str, SIZEOF(str));
- CharUpperBuff(str, lstrlen(str));
+ CharUpperBuff(str, mir_tstrlen(str));
SendMessage(hwndParent, DM_FINDNEXT, 0, (LPARAM)str);
return TRUE;
}
diff --git a/src/core/stdurl/urldialogs.cpp b/src/core/stdurl/urldialogs.cpp
index 89ea13b76b..1e11c7b2c5 100644
--- a/src/core/stdurl/urldialogs.cpp
+++ b/src/core/stdurl/urldialogs.cpp
@@ -69,7 +69,7 @@ static void sttUpdateTitle(HWND hwndDlg, MCONTACT hContact)
mir_sntprintf(newtitle, SIZEOF(newtitle), _T("%s %s (%s)"), pszNewTitleStart, contactName, szStatus);
}
}
- else lstrcpyn(newtitle, pszNewTitleStart, SIZEOF(newtitle));
+ else mir_tstrncpy(newtitle, pszNewTitleStart, SIZEOF(newtitle));
GetWindowText(hwndDlg, oldtitle, SIZEOF(oldtitle));
@@ -103,7 +103,7 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob);
db_event_get(dat->hDbEvent, &dbei);
SetDlgItemTextA(hwndDlg, IDC_URL, (char*)dbei.pBlob);
- SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+lstrlenA((char*)dbei.pBlob)+1);
+ SetDlgItemTextA(hwndDlg, IDC_MSG, (char*)dbei.pBlob+mir_strlen((char*)dbei.pBlob)+1);
mir_free(dbei.pBlob);
db_event_markRead(dat->hContact, dat->hDbEvent);
@@ -179,8 +179,8 @@ INT_PTR CALLBACK DlgProcUrlRecv(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
{ HGLOBAL hData;
if ( !OpenClipboard(hwndDlg)) break;
EmptyClipboard();
- hData = GlobalAlloc(GMEM_MOVEABLE, lstrlenA(url)+1);
- lstrcpyA((char*)GlobalLock(hData), url);
+ hData = GlobalAlloc(GMEM_MOVEABLE, mir_strlen(url)+1);
+ mir_strcpy((char*)GlobalLock(hData), url);
GlobalUnlock(hData);
SetClipboardData(CF_TEXT, hData);
CloseClipboard();
@@ -550,9 +550,9 @@ INT_PTR CALLBACK DlgProcUrlSend(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
body = (char*)mir_alloc(bodySize);
GetDlgItemTextA(hwndDlg, IDC_MESSAGE, body, bodySize);
- dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, lstrlenA(url)+lstrlenA(body)+2);
- lstrcpyA(dat->sendBuffer, url);
- lstrcpyA(dat->sendBuffer+lstrlenA(url)+1, body);
+ dat->sendBuffer = (char*)mir_realloc(dat->sendBuffer, mir_strlen(url)+mir_strlen(body)+2);
+ mir_strcpy(dat->sendBuffer, url);
+ mir_strcpy(dat->sendBuffer+mir_strlen(url)+1, body);
dat->hAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_EVENTSENT);
dat->hSendId = (HANDLE)CallContactService(dat->hContact, PSS_URL, 0, (LPARAM)dat->sendBuffer);
mir_free(url);
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp
index 59d9bc93c3..1d78f2cc13 100644
--- a/src/core/stduserinfo/contactinfo.cpp
+++ b/src/core/stduserinfo/contactinfo.cpp
@@ -68,9 +68,9 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
if (szText[0]) SetWindowText(hwndDlg, TranslateT("Edit phone number"));
TranslateDialogDefault(hwndDlg);
- if (lstrlenA(szText)>4 && !lstrcmpA(szText+lstrlenA(szText)-4, " SMS")) {
+ if (mir_strlen(szText)>4 && !lstrcmpA(szText+mir_strlen(szText)-4, " SMS")) {
CheckDlgButton(hwndDlg, IDC_SMS, BST_CHECKED);
- szText[lstrlenA(szText)-4] = '\0';
+ szText[mir_strlen(szText)-4] = '\0';
}
EnableWindow(GetDlgItem(hwndDlg, IDOK), szText[0]);
SendDlgItemMessage(hwndDlg, IDC_AREA, EM_LIMITTEXT, 31, 0);
@@ -91,13 +91,13 @@ static INT_PTR CALLBACK EditUserPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar
{ char *szText = (char*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
int isValid = 1;
GetDlgItemTextA(hwndDlg, IDC_PHONE, szText, 252);
- if (lstrlenA(szText)<7 || szText[0] != '+') isValid = 0;
- if (isValid) isValid = (lstrlenA(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
+ if (mir_strlen(szText)<7 || szText[0] != '+') isValid = 0;
+ if (isValid) isValid = (mir_strlen(szText+1) == (int)strspn(szText+1, "0123456789 ()-"));
if ( !isValid) {
MessageBox(hwndDlg, TranslateT("The phone number should start with a + and consist of numbers, spaces, brackets and hyphens only."), TranslateT("Invalid phone number"), MB_OK);
break;
}
- if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) lstrcatA(szText, " SMS");
+ if (IsDlgButtonChecked(hwndDlg, IDC_SMS)) mir_strcat(szText, " SMS");
}
//fall through
case IDCANCEL:
@@ -196,11 +196,11 @@ static int IsOverEmail(HWND hwndDlg, TCHAR* szEmail, int cchEmail)
SelectObject(hdc, hEmailFont);
SIZE textSize;
- GetTextExtentPoint32(hdc, szText, lstrlen(szText), &textSize);
+ GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &textSize);
ReleaseDC(hwndEmails, hdc);
if (hti.pt.x < rc.left+textSize.cx) {
if (szEmail && cchEmail)
- lstrcpyn(szEmail, szText, cchEmail);
+ mir_tstrncpy(szEmail, szText, cchEmail);
return 1;
}
return 0;
@@ -328,9 +328,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if ( !db_get_ts(hContact, szProto, "Cellular", &dbv)) {
lvi.pszText = TranslateT("Mobile");
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlenA(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+lstrlenA(dbv.pszVal)-4, " SMS")) {
+ if (mir_strlen(dbv.pszVal)>4 && !lstrcmpA(dbv.pszVal+mir_strlen(dbv.pszVal)-4, " SMS")) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ dbv.ptszVal[mir_tstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
@@ -359,9 +359,9 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
lvi.pszText = idstr2;
mir_sntprintf(idstr2, SIZEOF(idstr2), TranslateT("Custom %d"), i+1);
ListView_InsertItem(GetDlgItem(hwndDlg, IDC_PHONES), &lvi);
- if (lstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+lstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
+ if (mir_tstrlen(dbv.ptszVal)>4 && !lstrcmp(dbv.ptszVal+mir_tstrlen(dbv.ptszVal)-4, _T(" SMS"))) {
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 2, _T("y"));
- dbv.ptszVal[lstrlen(dbv.ptszVal)-4] = '\0';
+ dbv.ptszVal[mir_tstrlen(dbv.ptszVal)-4] = '\0';
}
ListView_SetItemText(GetDlgItem(hwndDlg, IDC_PHONES), lvi.iItem, 1, dbv.ptszVal);
db_free(&dbv);
@@ -493,7 +493,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DBVARIANT dbv;
mir_snprintf(idstr, SIZEOF(idstr), szIdTemplate, lvi.lParam);
if (db_get_s(hContact, "UserInfo", idstr, &dbv)) break;
- lstrcpynA(szText, dbv.pszVal, SIZEOF(szText));
+ mir_strncpy(szText, dbv.pszVal, SIZEOF(szText));
db_free(&dbv);
if (IDOK != DialogBoxParam(hInst, MAKEINTRESOURCE(nm->hdr.idFrom == IDC_PHONES?IDD_ADDPHONE:IDD_ADDEMAIL), hwndDlg, nm->hdr.idFrom == IDC_PHONES?EditUserPhoneDlgProc:EditUserEmailDlgProc, (LPARAM)szText))
break;
diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp
index 7cbaffdabb..3c407ee726 100644
--- a/src/core/stduserinfo/stdinfo.cpp
+++ b/src/core/stduserinfo/stdinfo.cpp
@@ -160,7 +160,7 @@ static void SetValue(HWND hwndDlg, int idCtrl, MCONTACT hContact, char *szModule
default:
pstr = str;
- lstrcpyA(str, "???");
+ mir_strcpy(str, "???");
break;
}
}
@@ -514,7 +514,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf.lfQuality = DEFAULT_QUALITY;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
- lstrcpy(lf.lfFaceName, _T("Courier New"));
+ mir_tstrcpy(lf.lfFaceName, _T("Courier New"));
lf.lfCharSet = DEFAULT_CHARSET;
hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0));