summaryrefslogtreecommitdiff
path: root/src/modules/chat
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-07-16 13:43:06 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-07-16 13:43:06 +0000
commiteefe0f0d556fbf3d77602d0a99b9134505050756 (patch)
tree41eef7b1ea9fca98c8e22be29ba0eb07fffb19e1 /src/modules/chat
parent9d8530d69c5896d91e8e9468e769a4eafb9cc53b (diff)
in _tcsncpy_s / _tcsncat_s / strncpy_s / strncat_s the second parameter to be omitted if the size of first one is fixed (not to contaminate sources with the excessive code)
git-svn-id: http://svn.miranda-ng.org/main/trunk@9829 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/chat')
-rw-r--r--src/modules/chat/chat_opts.cpp18
-rw-r--r--src/modules/chat/chat_svc.cpp2
-rw-r--r--src/modules/chat/clist.cpp2
-rw-r--r--src/modules/chat/tools.cpp2
4 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/chat/chat_opts.cpp b/src/modules/chat/chat_opts.cpp
index ffcd82d6d9..428d1e72f8 100644
--- a/src/modules/chat/chat_opts.cpp
+++ b/src/modules/chat/chat_opts.cpp
@@ -124,7 +124,7 @@ void LoadMsgDlgFont(int i, LOGFONT *lf, COLORREF *colour)
if (tszFace == NULL)
lstrcpy(lf->lfFaceName, FO.szDefFace);
else
- _tcsncpy_s(lf->lfFaceName, SIZEOF(lf->lfFaceName), tszFace, _TRUNCATE);
+ _tcsncpy_s(lf->lfFaceName, tszFace, _TRUNCATE);
}
}
@@ -136,13 +136,13 @@ void RegisterFonts(void)
FontIDT fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID | FIDF_NEEDRESTART;
- _tcsncpy_s(fontid.backgroundGroup, SIZEOF(fontid.backgroundGroup), g_szFontGroup, _TRUNCATE);
- _tcsncpy_s(fontid.group, SIZEOF(fontid.group), g_szFontGroup, _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundGroup, g_szFontGroup, _TRUNCATE);
+ _tcsncpy_s(fontid.group, g_szFontGroup, _TRUNCATE);
for (int i = 0; i < SIZEOF(fontOptionsList); i++, index++) {
FontOptionsList &FO = fontOptionsList[i];
strncpy(fontid.dbSettingsGroup, CHATFONT_MODULE, sizeof(fontid.dbSettingsGroup));
- _tcsncpy_s(fontid.name, SIZEOF(fontid.name), FO.szDescr, _TRUNCATE);
+ _tcsncpy_s(fontid.name, FO.szDescr, _TRUNCATE);
char idstr[10];
mir_snprintf(idstr, SIZEOF(idstr), "Font%d", index);
@@ -152,25 +152,25 @@ void RegisterFonts(void)
switch (i) {
case 18:
case 19:
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Nick list background"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, LPGENT("Nick list background"), _TRUNCATE);
break;
case 17:
if (g_iFontMode == FONTMODE_SKIP)
continue;
if (g_iFontMode == FONTMODE_USE) {
- _tcsncpy_s(fontid.name, SIZEOF(fontid.name), LPGENT("Message typing area"), _TRUNCATE);
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Message background"), _TRUNCATE);
+ _tcsncpy_s(fontid.name, LPGENT("Message typing area"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, LPGENT("Message background"), _TRUNCATE);
FO.defColour = RGB(0, 0, 40);
break;
}
- _tcsncpy_s(fontid.name, SIZEOF(fontid.name), LPGENT("Chat log symbols (Webdings)"), _TRUNCATE);
+ _tcsncpy_s(fontid.name, LPGENT("Chat log symbols (Webdings)"), _TRUNCATE);
FO.szDefFace = _T("Webdings");
FO.defColour = RGB(170, 170, 170);
FO.defCharset = SYMBOL_CHARSET;
// fall through
default:
- _tcsncpy_s(fontid.backgroundName, SIZEOF(fontid.backgroundName), LPGENT("Group chat log background"), _TRUNCATE);
+ _tcsncpy_s(fontid.backgroundName, LPGENT("Group chat log background"), _TRUNCATE);
break;
}
_tcsncpy(fontid.deffontsettings.szFace, FO.szDefFace, SIZEOF(fontid.deffontsettings.szFace));
diff --git a/src/modules/chat/chat_svc.cpp b/src/modules/chat/chat_svc.cpp
index 211e913d83..7363c4b36f 100644
--- a/src/modules/chat/chat_svc.cpp
+++ b/src/modules/chat/chat_svc.cpp
@@ -232,7 +232,7 @@ static INT_PTR Service_NewChat(WPARAM, LPARAM lParam)
if (si->iType == GCW_SERVER)
mir_sntprintf(szTemp, SIZEOF(szTemp), _T("Server: %s"), si->ptszName);
else
- _tcsncpy_s(szTemp, SIZEOF(szTemp), si->ptszName, _TRUNCATE);
+ _tcsncpy_s(szTemp, si->ptszName, _TRUNCATE);
si->hContact = ci.AddRoom(gcw->pszModule, gcw->ptszID, szTemp, si->iType);
db_set_s(si->hContact, si->pszModule, "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
diff --git a/src/modules/chat/clist.cpp b/src/modules/chat/clist.cpp
index a9e55d5fa6..d4de18e515 100644
--- a/src/modules/chat/clist.cpp
+++ b/src/modules/chat/clist.cpp
@@ -27,7 +27,7 @@ MCONTACT AddRoom(const char *pszModule, const TCHAR *pszRoom, const TCHAR *pszDi
TCHAR pszGroup[50]; *pszGroup = '\0';
ptrT groupName(db_get_tsa(NULL, CHAT_MODULE, "AddToGroup"));
if (groupName)
- _tcsncpy_s(pszGroup, SIZEOF(pszGroup), groupName, _TRUNCATE);
+ _tcsncpy_s(pszGroup, groupName, _TRUNCATE);
else
_tcscpy(pszGroup, _T("Chat rooms"));
diff --git a/src/modules/chat/tools.cpp b/src/modules/chat/tools.cpp
index dd74d42f1a..284753c0b4 100644
--- a/src/modules/chat/tools.cpp
+++ b/src/modules/chat/tools.cpp
@@ -744,7 +744,7 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
// we have to reparse the filename
TCHAR *tszNow = ci.MakeTimeStamp(_T("%a%d%m%Y"), tTime); // once a day
if (_tcscmp(tszOldTimeStamp, tszNow)) {
- _tcsncpy_s(tszOldTimeStamp, 30, tszNow, _TRUNCATE);
+ _tcsncpy_s(tszOldTimeStamp, tszNow, _TRUNCATE);
*si->pszLogFileName = 0;
}