summaryrefslogtreecommitdiff
path: root/src/modules/chat
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/modules/chat
parent4f0e30cdf56fbafdf955bbe8b93930bab9e39bd0 (diff)
lstr* replacements
git-svn-id: http://svn.miranda-ng.org/main/trunk@11176 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat')
-rw-r--r--src/modules/chat/chat_opts.cpp4
-rw-r--r--src/modules/chat/log.cpp16
-rw-r--r--src/modules/chat/manager.cpp6
-rw-r--r--src/modules/chat/tools.cpp18
4 files changed, 22 insertions, 22 deletions
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index 428d1e72f8..720f643acf 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -122,7 +122,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
ptrT tszFace(db_get_tsa(NULL, CHATFONT_MODULE, str));
if (tszFace == NULL)
- lstrcpy(lf->lfFaceName, FO.szDefFace);
+ mir_tstrcpy(lf->lfFaceName, FO.szDefFace);
else
_tcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
}
@@ -315,7 +315,7 @@ int OptionsInit(void)
LOGFONT lf;
LoadMsgDlgFont(18, &lf, NULL);
- lstrcpy(lf.lfFaceName, _T("MS Shell Dlg"));
+ mir_tstrcpy(lf.lfFaceName, _T("MS Shell Dlg"));
lf.lfUnderline = lf.lfItalic = lf.lfStrikeOut = 0;
lf.lfHeight = -17;
lf.lfWeight = FW_BOLD;
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 1133a66d68..e77d2013d8 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -198,7 +198,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;
}
@@ -226,11 +226,11 @@ static void AddEventToBuffer(char **buffer, int *bufferEnd, int *bufferAlloced,
TCHAR szTemp[512], szTemp2[512];
TCHAR* pszNick = NULL;
if (streamData->lin->ptszNick) {
- if (g_Settings->bLogLimitNames && lstrlen(streamData->lin->ptszNick) > 20) {
- lstrcpyn(szTemp2, streamData->lin->ptszNick, 20);
- lstrcpyn(szTemp2 + 20, _T("..."), 4);
+ if (g_Settings->bLogLimitNames && mir_tstrlen(streamData->lin->ptszNick) > 20) {
+ mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 20);
+ mir_tstrncpy(szTemp2 + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp2, streamData->lin->ptszNick, 511);
+ else mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 511);
if (streamData->lin->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
@@ -384,8 +384,8 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (g_Settings->bShowTime) {
TCHAR szTimeStamp[30], szOldTimeStamp[30];
- lstrcpyn(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
- lstrcpyn(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, streamData->si->LastTime), 30);
+ mir_tstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
+ mir_tstrncpy(szOldTimeStamp, 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);
@@ -398,7 +398,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
TCHAR pszTemp[300], *p1;
Log_Append(&buffer, &bufferEnd, &bufferAlloced, "%s ", Log_SetStyle(lin->bIsMe ? 2 : 1));
- 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';
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp
index 9028d3e02b..4f6666b99e 100644
--- a/src/modules/chat/manager.cpp
+++ b/src/modules/chat/manager.cpp
@@ -766,12 +766,12 @@ static char* SM_GetUsers(SESSION_INFO *si)
}
do {
- int pLen = lstrlenA(p), nameLen = lstrlen(utemp->pszUID);
+ int pLen = mir_strlen(p), nameLen = mir_tstrlen(utemp->pszUID);
if (pLen + nameLen + 2 > alloced)
p = (char*)mir_realloc(p, alloced += 4096);
WideCharToMultiByte(CP_ACP, 0, utemp->pszUID, -1, p + pLen, nameLen + 1, 0, 0);
- lstrcpyA(p + pLen + nameLen, " ");
+ mir_strcpy(p + pLen + nameLen, " ");
utemp = utemp->next;
}
while (utemp != NULL);
@@ -1184,7 +1184,7 @@ static BOOL UM_SetStatusEx(USERINFO* pUserList, const TCHAR* pszText, int flags)
if (s) {
pTemp->iStatusEx = 0;
if (s == pszText || s[-1] == cDelimiter) {
- int len = lstrlen(pTemp->pszUID);
+ int len = mir_tstrlen(pTemp->pszUID);
if (s[len] == cDelimiter || s[len] == '\0')
pTemp->iStatusEx = (!bOnlyMe || bSetStatus) ? 1 : 0;
}
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index 527b6307ac..160c3157b4 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -42,7 +42,7 @@ TCHAR* RemoveFormatting(const TCHAR *pszWord)
return NULL;
TCHAR *d = szTemp;
- int cbLen = lstrlen(pszWord);
+ int cbLen = mir_tstrlen(pszWord);
if (cbLen > SIZEOF(szTemp))
cbLen = SIZEOF(szTemp)-1;
@@ -165,7 +165,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
{
static TCHAR szBuf[4 * 1024];
- if (!fmt || fmt[0] == 0 || lstrlen(fmt) > 2000)
+ if (!fmt || fmt[0] == 0 || mir_tstrlen(fmt) > 2000)
return 0;
va_list marker;
@@ -186,7 +186,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
(pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
cli.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) {
@@ -469,7 +469,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
CreateDirectoryTreeT(tszFolder);
TCHAR szTime[100];
- lstrcpyn(szTime, ci.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
+ mir_tstrncpy(szTime, ci.MakeTimeStamp(g_Settings->pszTimeStampLog, gce->time), 99);
FILE *hFile = _tfopen(si->pszLogFileName, _T("ab+"));
if (hFile == NULL)
@@ -480,11 +480,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
if (bFileJustCreated)
fputws((const wchar_t*)"\377\376", hFile); //UTF-16 LE BOM == FF FE
if (gce->ptszNick) {
- if (g_Settings->bLogLimitNames && lstrlen(gce->ptszNick) > 20) {
- lstrcpyn(szTemp2, gce->ptszNick, 20);
- lstrcpyn(szTemp2 + 20, _T("..."), 4);
+ if (g_Settings->bLogLimitNames && mir_tstrlen(gce->ptszNick) > 20) {
+ mir_tstrncpy(szTemp2, gce->ptszNick, 20);
+ mir_tstrncpy(szTemp2 + 20, _T("..."), 4);
}
- else lstrcpyn(szTemp2, gce->ptszNick, 511);
+ else mir_tstrncpy(szTemp2, gce->ptszNick, 511);
if (gce->ptszUserInfo)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, gce->ptszUserInfo);
@@ -739,7 +739,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
rva[10].lptzValue = NULL;
TCHAR tszTemp[MAX_PATH], *ptszVarPath;
- if (g_Settings->pszLogDir[lstrlen(g_Settings->pszLogDir) - 1] == '\\') {
+ if (g_Settings->pszLogDir[mir_tstrlen(g_Settings->pszLogDir) - 1] == '\\') {
mir_sntprintf(tszTemp, SIZEOF(tszTemp), _T("%s%s"), g_Settings->pszLogDir, _T("%userid%.log"));
ptszVarPath = tszTemp;
}