summaryrefslogtreecommitdiff
path: root/src/modules/chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:23:03 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-04 22:23:03 +0000
commitefd438ad7b533ba2adb4f22a1cb358ee449db825 (patch)
treea5a4a84ee1b46b8902fc646d42056d574369b85a /src/modules/chat
parent65c19c2a4f8e907c56fbdbfb5bf500f33c218574 (diff)
new mir_sntprintf templates without SIZEOF
git-svn-id: http://svn.miranda-ng.org/main/trunk@14004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat')
-rw-r--r--src/modules/chat/chat_rtf.cpp6
-rw-r--r--src/modules/chat/chat_svc.cpp2
-rw-r--r--src/modules/chat/log.cpp2
-rw-r--r--src/modules/chat/tools.cpp32
4 files changed, 21 insertions, 21 deletions
diff --git a/src/modules/chat/chat_rtf.cpp b/src/modules/chat/chat_rtf.cpp
index 8373a833d5..255a051ef9 100644
--- a/src/modules/chat/chat_rtf.cpp
+++ b/src/modules/chat/chat_rtf.cpp
@@ -116,7 +116,7 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors)
else if (!_tcsncmp(p, _T("\\highlight"), 10)) { //background color
TCHAR szTemp[20];
int iCol = _ttoi(p + 10);
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), iCol);
+ mir_sntprintf(szTemp, _T("%d"), iCol);
}
else if (!_tcsncmp(p, _T("\\line"), 5)) { // soft line break;
res.AppendChar('\n');
@@ -196,8 +196,8 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors)
}
}
- if (bInsideUl)
- res.Append(_T("[/u]"));
+ if (bInsideUl)
+ res.Append(_T("[/u]"));
pszText = res;
return TRUE;
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index 168a786d62..31b0fc9080 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -233,7 +233,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
TCHAR szTemp[256];
if (si->iType == GCW_SERVER)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("Server: %s"), si->ptszName);
+ mir_sntprintf(szTemp, _T("Server: %s"), si->ptszName);
else
_tcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
si->hContact = ci.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
diff --git a/src/modules/chat/log.cpp b/src/modules/chat/log.cpp
index 59c37ff1c1..4ad98b44eb 100644
--- a/src/modules/chat/log.cpp
+++ b/src/modules/chat/log.cpp
@@ -232,7 +232,7 @@ static void AddEventToBuffer(char *&buffer, size_t &bufferEnd, size_t &bufferAll
else mir_tstrncpy(szTemp2, streamData->lin->ptszNick, 511);
if (streamData->lin->ptszUserInfo)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
+ mir_sntprintf(szTemp, _T("%s (%s)"), szTemp2, streamData->lin->ptszUserInfo);
else
_tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index fd4044515f..b91686d538 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -487,7 +487,7 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
else mir_tstrncpy(szTemp2, gce->ptszNick, 511);
if (gce->ptszUserInfo)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s (%s)"), szTemp2, gce->ptszUserInfo);
+ mir_sntprintf(szTemp, _T("%s (%s)"), szTemp2, gce->ptszUserInfo);
else
_tcsncpy_s(szTemp, szTemp2, _TRUNCATE);
pszNick = szTemp;
@@ -497,52 +497,52 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
case GC_EVENT_MESSAGE:
case GC_EVENT_MESSAGE | GC_EVENT_HIGHLIGHT:
p = '*';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, _T("%s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_ACTION:
case GC_EVENT_ACTION | GC_EVENT_HIGHLIGHT:
p = '*';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, _T("%s %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_JOIN:
p = '>';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s has joined"), pszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s has joined"), pszNick);
break;
case GC_EVENT_PART:
p = '<';
if (!gce->ptszText)
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s has left"), pszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s has left"), pszNick);
else
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s has left (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s has left (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_QUIT:
p = '<';
if (!gce->ptszText)
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s has disconnected"), pszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s has disconnected"), pszNick);
else
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s has disconnected (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s has disconnected (%s)"), pszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NICK:
p = '^';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
+ mir_sntprintf(szBuffer, TranslateT("%s is now known as %s"), gce->ptszNick, gce->ptszText);
break;
case GC_EVENT_KICK:
p = '~';
if (!gce->ptszText)
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s kicked %s"), gce->ptszStatus, gce->ptszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s kicked %s"), gce->ptszStatus, gce->ptszNick);
else
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s kicked %s (%s)"), gce->ptszStatus, gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("%s kicked %s (%s)"), gce->ptszStatus, gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_NOTICE:
p = 'o';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("Notice from %s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("Notice from %s: %s"), gce->ptszNick, ci.RemoveFormatting(gce->ptszText));
break;
case GC_EVENT_TOPIC:
p = '#';
if (!gce->ptszNick)
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("The topic is '%s'"), ci.RemoveFormatting(gce->ptszText));
+ mir_sntprintf(szBuffer, TranslateT("The topic is '%s'"), ci.RemoveFormatting(gce->ptszText));
else
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("The topic is '%s' (set by %s)"), ci.RemoveFormatting(gce->ptszText), gce->ptszNick);
+ mir_sntprintf(szBuffer, TranslateT("The topic is '%s' (set by %s)"), ci.RemoveFormatting(gce->ptszText), gce->ptszNick);
break;
case GC_EVENT_INFORMATION:
p = '!';
@@ -550,11 +550,11 @@ BOOL LogToFile(SESSION_INFO *si, GCEVENT *gce)
break;
case GC_EVENT_ADDSTATUS:
p = '+';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s enables '%s' status for %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s enables '%s' status for %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick);
break;
case GC_EVENT_REMOVESTATUS:
p = '-';
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s disables '%s' status for %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick);
+ mir_sntprintf(szBuffer, TranslateT("%s disables '%s' status for %s"), gce->ptszText, gce->ptszStatus, gce->ptszNick);
break;
}