summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM/src')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp10
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp6
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp7
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp14
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp2
-rw-r--r--plugins/TabSRMM/src/container.cpp18
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp4
-rw-r--r--plugins/TabSRMM/src/controls.cpp6
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp12
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp34
-rw-r--r--plugins/TabSRMM/src/globals.cpp2
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp10
-rw-r--r--plugins/TabSRMM/src/mim.cpp8
-rw-r--r--plugins/TabSRMM/src/modplus.cpp2
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp5
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp20
-rw-r--r--plugins/TabSRMM/src/msglog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp10
-rw-r--r--plugins/TabSRMM/src/msgs.cpp6
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp4
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp14
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp12
-rw-r--r--plugins/TabSRMM/src/srmm.cpp4
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp2
-rw-r--r--plugins/TabSRMM/src/templates.cpp2
-rw-r--r--plugins/TabSRMM/src/themeio.cpp6
-rw-r--r--plugins/TabSRMM/src/themes.cpp10
-rw-r--r--plugins/TabSRMM/src/themes.h2
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp4
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp4
-rw-r--r--plugins/TabSRMM/src/utils.cpp10
33 files changed, 132 insertions, 136 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index f5dba28146..db8b222025 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -72,7 +72,7 @@ static void CB_GetButtonSettings(MCONTACT hContact, CustomButtonData *cbd)
//modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden
- mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID);
+ mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID);
if (!db_get_s(hContact, "TabSRMM_Toolbar", SettingName, &dbv)) {
token = strtok(dbv.pszVal, "_");
@@ -830,8 +830,8 @@ void CB_WriteButtonSettings(MCONTACT hContact, CustomButtonData *cbd)
//modulename_buttonID, position_inIM_inCHAT_isLSide_isRSide_CanBeHidden
- mir_snprintf(SettingName, _countof(SettingName), "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID);
- mir_snprintf(SettingParameter, _countof(SettingParameter), "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden);
+ mir_snprintf(SettingName, "%s_%d", cbd->m_pszModuleName, cbd->m_dwButtonOrigID);
+ mir_snprintf(SettingParameter, "%d_%u_%u_%u_%u_%u", cbd->m_dwPosition, cbd->m_bIMButton, cbd->m_bChatButton, cbd->m_bLSided, cbd->m_bRSided, cbd->m_bCanBeHidden);
if (!(cbd->m_opFlags & BBSF_NTBDESTRUCT))
db_set_s(hContact, "TabSRMM_Toolbar", SettingName, SettingParameter);
else
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index 19e37c2676..f44bea11fc 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -537,7 +537,7 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData)
else _tcsncpy_s(szTemp, streamData->lin->ptszNick, _TRUNCATE);
if (g_Settings.bClickableNicks)
- mir_sntprintf(szTemp2, _countof(szTemp2), _T("~~++#%s#++~~"), szTemp);
+ mir_sntprintf(szTemp2, _T("~~++#%s#++~~"), szTemp);
else
_tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
@@ -723,7 +723,7 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
if (streamData->dat->dwFlags & MWF_DIVIDERWANTED || lin->dwFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", 17, 18, 0, 0, 5);
lin->dwFlags |= MWF_DIVIDERWANTED;
if (lin->prev || !streamData->bRedraw)
@@ -750,13 +750,13 @@ static char* Log_CreateRTF(LOGSTREAMDATA *streamData)
int iii;
if (lin->ptszNick && lin->iType == GC_EVENT_MESSAGE) {
iii = lin->bIsHighlighted ? 16 : (lin->bIsMe ? 2 : 1);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
else {
iii = lin->bIsHighlighted ? 16 : EventToIndex(lin);
- mir_snprintf(szStyle, _countof(szStyle), "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
+ mir_snprintf(szStyle, "\\f0\\cf%u\\ul0\\highlight0\\b%d\\i%d\\ul%d\\fs%u",
iii + 1, F.lfWeight >= FW_BOLD ? 1 : 0, F.lfItalic, F.lfUnderline, 2 * abs(F.lfHeight) * 74 / pci->logPixelSY);
str.Append(szStyle);
}
@@ -982,7 +982,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO *si, bool bRedra
// this uses hidden marks in the rich text to find the events which should be deleted
if (si->bTrimmed) {
TCHAR szPattern[50];
- mir_sntprintf(szPattern, _countof(szPattern), _T("~-+%d+-~"), si->pLogEnd);
+ mir_sntprintf(szPattern, _T("~-+%d+-~"), si->pLogEnd);
FINDTEXTEX fi;
fi.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index 9ac88e10b5..3ae21bda9e 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -184,7 +184,7 @@ static void OnLoadSettings()
for (int i = 0; i < 5; i++) {
char szBuf[40];
- mir_snprintf(szBuf, _countof(szBuf), "NickColor%d", i);
+ mir_snprintf(szBuf, "NickColor%d", i);
g_Settings.nickColors[i] = M.GetDword(CHAT_MODULE, szBuf, g_Settings.UserListColors[0]);
}
g_Settings.nickColors[5] = M.GetDword(CHAT_MODULE, "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index cba62770ff..8b857c7eb2 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -691,7 +691,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
TCHAR tszTooltipText[2048];
- mir_sntprintf(tszTooltipText, _countof(tszTooltipText),
+ mir_sntprintf(tszTooltipText,
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n\n")
_T("%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s\n%s - %s"),
@@ -757,12 +757,12 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
*p1 = 0;
TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10];
- mir_sntprintf(tszInitialDir, _countof(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p);
+ mir_sntprintf(tszInitialDir, _T("%s%s"), M.getChatLogPath(), p);
if (!PathFileExists(tszInitialDir))
_tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE);
TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0;
- mir_sntprintf(tszTemp, _countof(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
+ mir_sntprintf(tszTemp, _T("%s%c*.*%c%c"), TranslateT("All files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrInitialDir = tszInitialDir;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index d33f093eba..5b82f8b8e4 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -113,10 +113,7 @@ int ShowPopup(MCONTACT hContact, SESSION_INFO *si, HICON hIcon, char* pszProtoNa
pd.lchIcon = LoadIconEx("window");
PROTOACCOUNT *pa = Proto_GetAccount(pszProtoName);
- mir_sntprintf(pd.lptzContactName, _countof(pd.lptzContactName), _T("%s - %s"),
- (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName,
- pcli->pfnGetContactDisplayName(hContact, 0));
-
+ mir_sntprintf(pd.lptzContactName, _T("%s - %s"), (pa == NULL) ? _A2T(pszProtoName) : pa->tszAccountName, pcli->pfnGetContactDisplayName(hContact, 0));
_tcsncpy_s(pd.lptzText, TranslateTS(szBuf), _TRUNCATE);
pd.iSeconds = g_Settings.iPopupTimeout;
@@ -536,7 +533,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
if (pszWordText && pszWordText[0]) {
TCHAR szMenuText[4096];
- mir_sntprintf(szMenuText, _countof(szMenuText), TranslateT("Look up '%s':"), pszWordText);
+ mir_sntprintf(szMenuText, TranslateT("Look up '%s':"), pszWordText);
ModifyMenu(*hMenu, 4, MF_STRING | MF_BYPOSITION, 4, szMenuText);
}
else ModifyMenu(*hMenu, 4, MF_STRING | MF_GRAYED | MF_BYPOSITION, 4, TranslateT("No word to look up"));
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 56cc362ab0..a7490efb38 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -1323,7 +1323,7 @@ static void ProcessNickListHovering(HWND hwnd, int hoveredItem, SESSION_INFO *pa
}
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s: %s\r\n%s: %s\r\n%s: %s"),
+ mir_sntprintf(tszBuf, _T("%s: %s\r\n%s: %s\r\n%s: %s"),
TranslateT("Nickname"), ui1->pszNick,
TranslateT("Unique ID"), ui1->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status));
@@ -1671,7 +1671,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
}
if (tszBuf[0] == 0)
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"),
+ mir_sntprintf(tszBuf, _T("<b>%s:</b>\t%s\n<b>%s:</b>\t%s\n<b>%s:</b>\t%s"),
TranslateT("Nick"), ui1->pszNick,
TranslateT("Unique ID"), ui1->pszUID,
TranslateT("Status"), pci->TM_WordToString(parentdat->pStatuses, ui1->Status));
@@ -1976,17 +1976,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
else if (diff > 59) {
DWORD hours = diff / 60;
DWORD minutes = diff % 60;
- mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ?
+ mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s, %d %s idle"), hours, hours > 1 ?
TranslateT("hours") : TranslateT("hour"),
minutes, minutes > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
- else mir_sntprintf(mi->tszIdleMsg, _countof(mi->tszIdleMsg), TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
+ else mir_sntprintf(mi->tszIdleMsg, TranslateT(", %d %s idle"), diff, diff > 1 ? TranslateT("minutes") : TranslateT("minute"));
}
- mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg);
+ mir_sntprintf(szFinalStatusBarText, TranslateT("%s on %s%s"), dat->szMyNickname, mi->ptszModDispName, mi->tszIdleMsg);
}
else {
if (si->ptszStatusbarText)
- mir_sntprintf(szFinalStatusBarText, _countof(szFinalStatusBarText), _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText);
+ mir_sntprintf(szFinalStatusBarText, _T("%s %s"), mi->ptszModDispName, si->ptszStatusbarText);
else
_tcsncpy_s(szFinalStatusBarText, mi->ptszModDispName, _TRUNCATE);
}
@@ -3165,7 +3165,7 @@ LABEL_SHOWWINDOW:
DBVARIANT dbv = { 0 };
char szIndex[10];
char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
+ mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 0787ab83e0..e6e829119b 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -190,7 +190,7 @@ bool CContactCache::updateUIN()
mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_sntprintf(m_szUIN, _countof(m_szUIN), _T("%u"), ci.dVal);
+ mir_sntprintf(m_szUIN, _T("%u"), ci.dVal);
break;
}
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 8eb2bcea84..e8bb310e01 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -607,7 +607,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
else {
char szCName[CONTAINER_NAMELEN + 20];
- mir_snprintf(szCName, _countof(szCName), "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
@@ -1334,14 +1334,14 @@ panel_found:
pContainer->settings = &PluginConfig.globalContainerSettings;
pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
- mir_snprintf(szCname, _countof(szCname), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCname, "%s_theme", CONTAINER_PREFIX);
if (!db_get_ts(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == NULL) {
- mir_snprintf(szCname, _countof(szCname), "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_theme", CONTAINER_PREFIX, pContainer->iContainerIndex);
if (!db_get_ts(NULL, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
@@ -1713,13 +1713,13 @@ panel_found:
}
else {
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dx", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dy", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
- mir_snprintf(szCName, _countof(szCName), "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dwidth", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- mir_snprintf(szCName, _countof(szCName), "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%dheight", CONTAINER_PREFIX, pContainer->iContainerIndex);
db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd == SW_SHOWMAXIMIZED) ? 1 : 0));
@@ -1737,7 +1737,7 @@ panel_found:
SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
char szCName[40];
- mir_snprintf(szCName, _countof(szCName), "%s_theme", CONTAINER_PREFIX);
+ mir_snprintf(szCName, "%s_theme", CONTAINER_PREFIX);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -1900,7 +1900,7 @@ int TSAPI CutContactName(const TCHAR *oldname, TCHAR *newname, unsigned int size
_tcsncpy_s(newname, size, oldname, _TRUNCATE);
else {
TCHAR fmt[30];
- mir_sntprintf(fmt, _countof(fmt), _T("%%%d.%ds..."), cutMax, cutMax);
+ mir_sntprintf(fmt, _T("%%%d.%ds..."), cutMax, cutMax);
mir_sntprintf(newname, size, fmt, oldname);
}
return 0;
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index 61d55a1718..efae584b93 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
TranslateDialogDefault(hwndDlg);
SetWindowText(hwndDlg, TranslateT("Container options"));
TCHAR szNewTitle[128];
- mir_sntprintf(szNewTitle, _countof(szNewTitle), _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
+ mir_sntprintf(szNewTitle, _T("%s"), !mir_tstrcmp(pContainer->szName, _T("default")) ?
TranslateT("Default container") : pContainer->szName);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, szNewTitle);
Utils::enableDlgControl(hwndDlg, IDC_O_HIDETITLE, !CSkin::m_frameSkins);
@@ -258,7 +258,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
else {
if (pContainer->settings != &PluginConfig.globalContainerSettings) {
char szCname[40];
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
pContainer->settings->fPrivate = false;
db_set_blob(0, SRMSGMOD_T, szCname, pContainer->settings, sizeof(TContainerSettings));
mir_free(pContainer->settings);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index dc6f9fc897..2b756b52f0 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -966,12 +966,12 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (!mir_strcmp(sid->szModule, MSG_ICON_MODULE)) {
if (sid->dwId == MSG_ICON_SOUND)
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
+ mir_sntprintf(wBuf, TranslateT("Sounds are %s. Click to toggle status, hold SHIFT and click to set for all open containers"),
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && dat && (dat->bType == SESSIONTYPE_IM || dat->si->iType == GCW_PRIVMESS)) {
int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
- mir_sntprintf(wBuf, _countof(wBuf), TranslateT("Sending typing notifications is %s."),
+ mir_sntprintf(wBuf, TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
else if (sid->dwId == MSG_ICON_SESSION)
@@ -997,7 +997,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
const TCHAR *szFormat = TranslateT("There are %d pending send jobs. Message length: %d bytes, message length limit: %d bytes\n\n%d messages are queued for later delivery");
- mir_sntprintf(wBuf, _countof(wBuf), szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
+ mir_sntprintf(wBuf, szFormat, dat->iOpenJobs, iLength, dat->nMax ? dat->nMax : 20000, iQueued);
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 68a3918fbb..83c12082e3 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -500,7 +500,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
TCHAR szHeader[256];
if (pdata->pluginOptions->bShowHeaders)
- mir_sntprintf(szHeader, _countof(szHeader), _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
+ mir_sntprintf(szHeader, _T("%s %d\n"), TranslateT("New messages: "), pdata->nrMerged + 1);
else
szHeader[0] = 0;
@@ -513,7 +513,7 @@ static int PopupUpdateT(MCONTACT hContact, MEVENT hEvent)
TCHAR timestamp[MAX_DATASIZE];
_tcsftime(timestamp, MAX_DATASIZE, _T("%Y.%m.%d %H:%M"), _localtime32((__time32_t *)&dbe.timestamp));
- mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _countof(pdata->eventData[pdata->nrMerged].tszText), _T("\n\n%s\n"), timestamp);
+ mir_sntprintf(pdata->eventData[pdata->nrMerged].tszText, _T("\n\n%s\n"), timestamp);
TCHAR *szPreview = GetPreviewT(dbe.eventType, &dbe);
if (szPreview) {
@@ -672,7 +672,7 @@ void TSAPI UpdateTrayMenuState(TWindowData *dat, BOOL bForced)
PluginConfig.m_UnreadInTray -= (mii.dwItemData & 0x0000ffff);
if (mii.dwItemData > 0 || bForced) {
TCHAR szMenuEntry[80];
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszProto,
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszProto,
dat->cache->getNick(), dat->szStatus[0] ? dat->szStatus : _T("(undef)"), mii.dwItemData & 0x0000ffff);
if (!bForced)
@@ -717,7 +717,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
if (fromEvent == 2) // from chat...
mii.dwItemData |= 0x10000000;
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
PluginConfig.m_UnreadInTray++;
if (PluginConfig.m_UnreadInTray)
@@ -727,7 +727,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
else {
szNick = pcli->pfnGetContactDisplayName(hContact, 0);
if (CheckMenuItem(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == -1) {
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, fromEvent ? 1 : 0);
AppendMenu(PluginConfig.g_hMenuTrayUnread, MF_BYCOMMAND | MF_STRING, (UINT_PTR)hContact, szMenuEntry);
mii.dwItemData = fromEvent ? 1 : 0;
PluginConfig.m_UnreadInTray += (mii.dwItemData & 0x0000ffff);
@@ -745,7 +745,7 @@ int TSAPI UpdateTrayMenu(const TWindowData *dat, WORD wStatus, const char *szPro
mii.fMask |= MIIM_STRING;
if (fromEvent == 2)
mii.dwItemData |= 0x10000000;
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s) [%d]"), tszFinalProto, szNick, szMyStatus, mii.dwItemData & 0x0000ffff);
mii.cch = (int)mir_tstrlen(szMenuEntry) + 1;
mii.dwTypeData = (LPTSTR)szMenuEntry;
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index adcc0acbe8..8e7ad1bcdd 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -45,12 +45,12 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat)
else if (dat) {
TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH];
mir_sntprintf(szFilter, _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0);
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s.rtf"), dat->cache->getNick());
+ mir_sntprintf(szFilename, _T("%s.rtf"), dat->cache->getNick());
Utils::sanitizeFilename(szFilename);
TCHAR szInitialDir[MAX_PATH + 2];
- mir_sntprintf(szInitialDir, _countof(szInitialDir), _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs"));
+ mir_sntprintf(szInitialDir, _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs"));
CreateDirectoryTreeT(szInitialDir);
OPENFILENAME ofn = { 0 };
@@ -613,7 +613,7 @@ static INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
CallService(MS_SYSTEM_GETFILEVERSION, 0, (LPARAM)&v);
TCHAR tStr[80];
- mir_sntprintf(tStr, _countof(tStr), _T("%s %d.%d.%d.%d [build %d]"),
+ mir_sntprintf(tStr, _T("%s %d.%d.%d.%d [build %d]"),
TranslateT("Version"), __MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM, v[3]);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, tStr);
}
@@ -1002,7 +1002,7 @@ void TSAPI DM_LoadLocale(TWindowData *dat)
if (!PluginConfig.m_bDontUseDefaultKbd) {
TCHAR szBuf[20];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20);
- mir_sntprintf(szKLName, _countof(szKLName), _T("0000%s"), szBuf);
+ mir_sntprintf(szKLName, _T("0000%s"), szBuf);
db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
}
else {
@@ -1040,7 +1040,7 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
TCHAR szBuf[100];
if (dat->bShowTyping) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]);
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s is typing a message..."), dat->cache->getNick());
+ mir_sntprintf(szBuf, TranslateT("%s is typing a message..."), dat->cache->getNick());
}
else if (dat->sbCustom) {
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, (LPARAM)dat->sbCustom->hIcon);
@@ -1051,14 +1051,14 @@ void TSAPI DM_UpdateLastMessage(const TWindowData *dat)
SendMessage(dat->pContainer->hwndStatus, SB_SETICON, 0, 0);
if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR)
- mir_sntprintf(szBuf, _countof(szBuf), _T("UID: %s"), dat->cache->getUIN());
+ mir_sntprintf(szBuf, _T("UID: %s"), dat->cache->getUIN());
else if (dat->lastMessage) {
TCHAR date[64], time[64];
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("d"), date, _countof(date), 0);
if (dat->pContainer->dwFlags & CNT_UINSTATUSBAR && mir_tstrlen(date) > 6)
date[mir_tstrlen(date) - 5] = 0;
TimeZone_PrintTimeStamp(NULL, dat->lastMessage, _T("t"), time, _countof(time), 0);
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Last received: %s at %s"), date, time);
+ mir_sntprintf(szBuf, TranslateT("Last received: %s at %s"), date, time);
}
else szBuf[0] = 0;
}
@@ -1378,7 +1378,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
dat->bShowTyping = 2;
dat->nTypeSecs = 86400;
- mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s has entered text."), dat->cache->getNick());
+ mir_sntprintf(dat->szStatusBar, TranslateT("%s has entered text."), dat->cache->getNick());
if (hwndStatus && dat->pContainer->hwndActive == hwndDlg)
SendMessage(hwndStatus, SB_SETTEXT, 0, (LPARAM)dat->szStatusBar);
}
@@ -1403,7 +1403,7 @@ void TSAPI DM_Typing(TWindowData *dat, bool fForceOff)
UpdateStatusBar(dat);
}
else if (dat->nTypeSecs > 0) {
- mir_sntprintf(dat->szStatusBar, _countof(dat->szStatusBar), TranslateT("%s is typing a message"), dat->cache->getNick());
+ mir_sntprintf(dat->szStatusBar, TranslateT("%s is typing a message"), dat->cache->getNick());
dat->nTypeSecs--;
if (hwndStatus && dat->pContainer->hwndActive == hwndDlg) {
@@ -1596,7 +1596,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM hContact, LPARAM lParam)
dat->hQueuedEvents[dat->iNextQueuedEvent++] = hDbEvent;
TCHAR szBuf[100];
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"),
+ mir_sntprintf(szBuf, TranslateT("Auto scrolling is disabled, %d message(s) queued (press F12 to enable it)"),
dat->iNextQueuedEvent);
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf);
RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE);
@@ -1748,7 +1748,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
if (mir_tstrlen(newcontactname) != 0) {
if (PluginConfig.m_bStatusOnTabs)
- mir_sntprintf(newtitle, _countof(newtitle), _T("%s (%s)"), newcontactname, dat->szStatus);
+ mir_sntprintf(newtitle, _T("%s (%s)"), newcontactname, dat->szStatus);
else
_tcsncpy_s(newtitle, newcontactname, _TRUNCATE);
}
@@ -1760,13 +1760,13 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM, LPARAM lParam)
TCHAR fulluin[256];
if (dat->bIsMeta)
- mir_sntprintf(fulluin, _countof(fulluin),
- TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."),
- bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
+ mir_sntprintf(fulluin,
+ TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nRight click for metacontact control\nClick dropdown to add or remove user from your favorites."),
+ bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
else
- mir_sntprintf(fulluin, _countof(fulluin),
- TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."),
- bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
+ mir_sntprintf(fulluin,
+ TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for user's details\nClick dropdown to change this contact's favorite status."),
+ bHasName ? dat->cache->getUIN() : TranslateT("No UID"));
SendDlgItemMessage(hwndDlg, IDC_NAME, BUTTONADDTOOLTIP, (WPARAM)fulluin, BATF_TCHAR);
}
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 71caabbe25..de11658856 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -545,7 +545,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
cle.hDbEvent = hDbEvent;
TCHAR toolTip[256];
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), pcli->pfnGetContactDisplayName(hContact, 0));
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 2cf7ed0abc..5b2cccb984 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -496,7 +496,7 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
time_t diff = time(NULL) - m_dat->idle;
int i_hrs = diff / 3600;
int i_mins = (diff - i_hrs * 3600) / 60;
- mir_sntprintf(szBuf, _countof(szBuf), TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
+ mir_sntprintf(szBuf, TranslateT("%s Idle: %dh,%02dm"), tszUin, i_hrs, i_mins);
}
else _tcscpy_s(szBuf, 256, tszUin);
@@ -613,7 +613,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
if (m_height < DEGRADE_THRESHOLD) {
TCHAR tszText[2048];
- mir_sntprintf(tszText, _countof(tszText), TranslateT("Topic is: %s"),
+ mir_sntprintf(tszText, TranslateT("Topic is: %s"),
si->ptszTopic ? si->ptszTopic : TranslateT("no topic set."));
hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -670,7 +670,7 @@ void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
SIZE szTitle;
TCHAR szPrefix[100];
- mir_sntprintf(szPrefix, _countof(szPrefix), TranslateT("Topic is: %s"), _T(""));
+ mir_sntprintf(szPrefix, TranslateT("Topic is: %s"), _T(""));
::GetTextExtentPoint32(hdc, szPrefix, (int)mir_tstrlen(szPrefix), &szTitle);
mapRealRect(rcItem, m_rcUIN, szTitle);
if (m_hoverFlags & HOVER_UIN)
@@ -1061,11 +1061,11 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
case WM_INITDIALOG:
{
TCHAR tszTitle[100];
- mir_sntprintf(tszTitle, _countof(tszTitle), TranslateT("Set panel visibility for this %s"),
+ mir_sntprintf(tszTitle, TranslateT("Set panel visibility for this %s"),
m_isChat ? TranslateT("chat room") : TranslateT("contact"));
::SetDlgItemText(hwnd, IDC_STATIC_VISIBILTY, tszTitle);
- mir_sntprintf(tszTitle, _countof(tszTitle), m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
+ mir_sntprintf(tszTitle, m_isChat ? TranslateT("Do not synchronize the panel height with IM windows") :
TranslateT("Do not synchronize the panel height with group chat windows"));
::SetDlgItemText(hwnd, IDC_NOSYNC, tszTitle);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index 9d71be195b..0672bb15f9 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -149,7 +149,7 @@ void CMimAPI::InitPaths()
{
const TCHAR *szUserdataDir = getUserDir();
- mir_sntprintf(m_szProfilePath, _countof(m_szProfilePath), _T("%stabSRMM"), szUserdataDir);
+ mir_sntprintf(m_szProfilePath, _T("%stabSRMM"), szUserdataDir);
if (ServiceExists(MS_FOLDERS_REGISTER_PATH)) {
_tcsncpy_s(m_szChatLogsPath, _T("%miranda_logpath%"), _TRUNCATE);
_tcsncpy_s(m_szSkinsPath, _T("%miranda_path%\\Skins\\TabSRMM"), _TRUNCATE);
@@ -164,7 +164,7 @@ void CMimAPI::InitPaths()
Utils::ensureTralingBackslash(m_szSkinsPath);
- mir_sntprintf(m_szSavedAvatarsPath, _countof(m_szSavedAvatarsPath), _T("%s\\Saved Contact Pictures"), m_szProfilePath);
+ mir_sntprintf(m_szSavedAvatarsPath, _T("%s\\Saved Contact Pictures"), m_szProfilePath);
}
bool CMimAPI::getAeroState()
@@ -299,7 +299,7 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
if (mode) {
TCHAR szTip[256];
- mir_sntprintf(szTip, _countof(szTip), TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szTip, TranslateT("%s is typing a message"), pcli->pfnGetContactDisplayName(hContact, 0));
if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
@@ -550,7 +550,7 @@ nowindowcreate:
cle.hIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
cle.pszService = "SRMsg/ReadMessage";
contactName = pcli->pfnGetContactDisplayName(hContact, 0);
- mir_sntprintf(toolTip, _countof(toolTip), TranslateT("Message from %s"), contactName);
+ mir_sntprintf(toolTip, TranslateT("Message from %s"), contactName);
cle.ptszTooltip = toolTip;
CallService(MS_CLIST_ADDEVENT, 0, (LPARAM)&cle);
}
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 04b8cea8dd..42c2c16eb1 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -43,7 +43,7 @@
static TCHAR* getMenuEntry(int i)
{
char MEntry[256];
- mir_snprintf(MEntry, _countof(MEntry), "MenuEntry_%u", i);
+ mir_snprintf(MEntry, "MenuEntry_%u", i);
return db_get_tsa(NULL, "tabmodplus", MEntry);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 2684e40073..e5b790f142 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -2326,8 +2326,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (iIndex < SendQueue::NR_SENDJOBS) { // single sendjob timer
SendJob *job = sendQueue->getJobByIndex(iIndex);
KillTimer(hwndDlg, wParam);
- mir_sntprintf(job->szErrorMsg, _countof(job->szErrorMsg), TranslateT("Delivery failure: %s"),
- TranslateT("The message send timed out"));
+ mir_sntprintf(job->szErrorMsg, TranslateT("Delivery failure: %s"), TranslateT("The message send timed out"));
job->iStatus = SendQueue::SQ_ERROR;
if (!nen_options.iNoSounds && !(m_pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("SendError");
@@ -2544,7 +2543,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
char szIndex[10];
char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, _countof(szIndex), "%d", iSelection - IDM_CONTAINERMENU);
+ mir_snprintf(szIndex, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
ptrT val(db_get_tsa(NULL, szKey, szIndex));
if (val)
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 8bbf9a2ede..2bae8fe5e1 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -135,12 +135,12 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
DWORD setView = 1;
TCHAR szTimestamp[100];
- mir_sntprintf(szTimestamp, _countof(szTimestamp), _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
+ mir_sntprintf(szTimestamp, _T("%04u %02u %02u_%02u%02u"), lt->tm_year + 1900, lt->tm_mon, lt->tm_mday, lt->tm_hour, lt->tm_min);
TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
TCHAR szFinalPath[MAX_PATH];
- mir_sntprintf(szFinalPath, _countof(szFinalPath), _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
+ mir_sntprintf(szFinalPath, _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -153,17 +153,17 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
TCHAR szBaseName[MAX_PATH];
if (isOwnPic)
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("My Avatar_%s"), szTimestamp);
+ mir_sntprintf(szBaseName, _T("My Avatar_%s"), szTimestamp);
else
- mir_sntprintf(szBaseName, _countof(szBaseName), _T("%s_%s"), dat->cache->getNick(), szTimestamp);
+ mir_sntprintf(szBaseName, _T("%s_%s"), dat->cache->getNick(), szTimestamp);
- mir_sntprintf(szFinalFilename, _countof(szFinalFilename), _T("%s.png"), szBaseName);
+ mir_sntprintf(szFinalFilename, _T("%s.png"), szBaseName);
// do not allow / or \ or % in the filename
Utils::sanitizeFilename(szFinalFilename);
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.bmp;*.png;*.jpg;*.gif%c%c"), TranslateT("Image files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lpstrDefExt = _T("png");
@@ -1048,7 +1048,7 @@ void TSAPI GetMYUIN(TWindowData *dat)
mir_free((void*)ci.pszVal);
break;
case CNFT_DWORD:
- mir_sntprintf(dat->myUin, _countof(dat->myUin), _T("%u"), ci.dVal);
+ mir_sntprintf(dat->myUin, _T("%u"), ci.dVal);
break;
default:
dat->myUin[0] = 0;
@@ -1285,7 +1285,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
TCHAR szKey[20];
DWORD dwLID = _tcstoul(szKLName, &stopped, 16);
- mir_sntprintf(szKey, _countof(szKey), _T("%04.04x"), LOWORD(dwLID));
+ mir_sntprintf(szKey, _T("%04.04x"), LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, _T("MIME\\Database\\Rfc1766"), 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
@@ -1305,7 +1305,7 @@ void TSAPI GetLocaleID(TWindowData *dat, const TCHAR *szKLName)
_tcsupr(szLI);
}
fLocaleNotSet = (dat->lcID[0] == 0 && dat->lcID[1] == 0);
- mir_sntprintf(dat->lcID, _countof(dat->lcID), szLI);
+ mir_sntprintf(dat->lcID, szLI);
GetStringTypeA(dat->lcid, CT_CTYPE2, (char*)szTest, 3, wCtype2);
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_RTLPARA;
@@ -1956,7 +1956,7 @@ void TSAPI SendHBitmapAsFile(const TWindowData *dat, HBITMAP hbmp)
if (filename[0] == 0) { // prompting to save
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.jpg%c%c"), TranslateT("JPEG-compressed images"), 0, 0, 0);
OPENFILENAME dlg;
dlg.lStructSize = sizeof(dlg);
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 3bcf1b8a56..a02cbf2f66 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -129,9 +129,9 @@ void TSAPI CacheLogFonts()
memset(logfonts, 0, (sizeof(LOGFONTA) * (MSGDLGFONTCOUNT + 2)));
for (int i = 0; i < MSGDLGFONTCOUNT; i++) {
LoadLogfont(i, &logfonts[i], &fontcolors[i], FONTMODULE);
- mir_snprintf(rtfFontsGlobal[i], _countof(rtfFontsGlobal[i]), "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
+ mir_snprintf(rtfFontsGlobal[i], "\\f%u\\cf%u\\b%d\\i%d\\ul%d\\fs%u", i, i, logfonts[i].lfWeight >= FW_BOLD ? 1 : 0, logfonts[i].lfItalic, logfonts[i].lfUnderline, 2 * abs(logfonts[i].lfHeight) * 74 / logPixelSY);
}
- mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], _countof(rtfFontsGlobal[MSGDLGFONTCOUNT]), "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
+ mir_snprintf(rtfFontsGlobal[MSGDLGFONTCOUNT], "\\f%u\\cf%u\\b%d\\i%d\\fs%u", MSGDLGFONTCOUNT, MSGDLGFONTCOUNT, 0, 0, 0);
_tcsncpy(szToday, TranslateT("Today"), 20);
_tcsncpy(szYesterday, TranslateT("Yesterday"), 20);
@@ -460,7 +460,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact,
if (dwEffectiveFlags & MWF_DIVIDERWANTED) {
static char szStyle_div[128] = "\0";
if (szStyle_div[0] == 0)
- mir_snprintf(szStyle_div, _countof(szStyle_div), "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
+ mir_snprintf(szStyle_div, "\\f%u\\cf%u\\ul0\\b%d\\i%d\\fs%u", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS, 0, 0, 5);
str.AppendFormat("\\sl-1\\slmult0\\highlight%d\\cf%d\\-\\par\\sl0", H_MSGFONTID_DIVIDERS, H_MSGFONTID_DIVIDERS);
dat->dwFlags &= ~MWF_DIVIDERWANTED;
@@ -1029,7 +1029,7 @@ static void SetupLogFormatting(TWindowData *dat)
if (dat->hHistoryEvents)
strncpy_s(dat->szMicroLf, "\\v\\cf%d \\ ~-+%d+-~\\v0 ", _TRUNCATE);
else
- mir_snprintf(dat->szMicroLf, _countof(dat->szMicroLf), "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
+ mir_snprintf(dat->szMicroLf, "%s\\par\\ltrpar\\sl-1%s ", GetRTFFont(MSGDLGFONTCOUNT), GetRTFFont(MSGDLGFONTCOUNT));
}
static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppend, BOOL isSent)
@@ -1139,7 +1139,7 @@ static void ReplaceIcons(HWND hwndDlg, TWindowData *dat, LONG startAt, int fAppe
if (dat->hHistoryEvents && dat->curHistory == dat->maxHistory) {
char szPattern[50];
- mir_snprintf(szPattern, _countof(szPattern), "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
+ mir_snprintf(szPattern, "~-+%d+-~", (INT_PTR)dat->hHistoryEvents[0]);
FINDTEXTEXA ft;
ft.lpstrText = szPattern;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index e73b29fc00..d1930bc4da 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -75,7 +75,7 @@ void TSAPI LoadLogfont(int i, LOGFONTA * lf, COLORREF * colour, char *szModule)
lf->lfClipPrecision = lfResult.lfClipPrecision;
lf->lfQuality = lfResult.lfQuality;
lf->lfPitchAndFamily = lfResult.lfPitchAndFamily;
- mir_snprintf(lf->lfFaceName, _countof(lf->lfFaceName), "%S", lfResult.lfFaceName);
+ mir_snprintf(lf->lfFaceName, "%S", lfResult.lfFaceName);
}
}
@@ -97,7 +97,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
{
bool fValid = false;
TCHAR tszMask[MAX_PATH];
- mir_sntprintf(tszMask, _countof(tszMask), _T("%s*.*"), tszFolder);
+ mir_sntprintf(tszMask, _T("%s*.*"), tszFolder);
WIN32_FIND_DATA fd = { 0 };
HANDLE h = FindFirstFile(tszMask, &fd);
@@ -117,7 +117,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
LRESULT lr;
TCHAR szBuf[255];
- mir_sntprintf(tszFinalName, _countof(tszFinalName), _T("%s%s"), tszFolder, fd.cFileName);
+ mir_sntprintf(tszFinalName, _T("%s%s"), tszFolder, fd.cFileName);
GetPrivateProfileString(_T("Global"), _T("Name"), _T("None"), szBuf, _countof(szBuf), tszFinalName);
if (!mir_tstrcmp(szBuf, _T("None"))) {
@@ -153,7 +153,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
_tcsncpy_s(tszSkinRoot, M.getSkinPath(), _TRUNCATE);
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
- mir_sntprintf(tszFindMask, _countof(tszFindMask), _T("%s*.*"), tszSkinRoot);
+ mir_sntprintf(tszFindMask, _T("%s*.*"), tszSkinRoot);
SendMessage(hwndCombobox, CB_RESETCONTENT, 0, 0);
SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)TranslateT("<no skin>"));
@@ -163,7 +163,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
while (h != INVALID_HANDLE_VALUE) {
if (fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY && fd.cFileName[0] != '.') {
TCHAR tszSubDir[MAX_PATH];
- mir_sntprintf(tszSubDir, _countof(tszSubDir), _T("%s%s\\"), tszSkinRoot, fd.cFileName);
+ mir_sntprintf(tszSubDir, _T("%s%s\\"), tszSkinRoot, fd.cFileName);
ScanSkinDir(tszSubDir, hwndCombobox);
}
if (FindNextFile(h, &fd) == 0)
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 5f7569d711..fc987b266e 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -484,9 +484,9 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact,
TCHAR *szStatus = pcli->pfnGetStatusModeDescription(szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), 0);
if (M.GetByte("tabstatus", 1))
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s (%s) "), newcontactname, szStatus);
+ mir_sntprintf(tabtitle, _T("%s (%s) "), newcontactname, szStatus);
else
- mir_sntprintf(tabtitle, _countof(tabtitle), _T("%s "), newcontactname);
+ mir_sntprintf(tabtitle, _T("%s "), newcontactname);
newData.item.pszText = tabtitle;
newData.item.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
@@ -1046,7 +1046,7 @@ STDMETHODIMP CREOleCallback::GetInPlaceContext(LPOLEINPLACEFRAME*, LPOLEINPLACEU
STDMETHODIMP CREOleCallback::GetNewStorage(LPSTORAGE *lplpstg)
{
TCHAR sztName[64];
- mir_sntprintf(sztName, _countof(sztName), _T("s%u"), nextStgId++);
+ mir_sntprintf(sztName, _T("s%u"), nextStgId++);
if (pictStg == NULL)
return STG_E_MEDIUMFULL;
return pictStg->CreateStorage(sztName, STGM_READWRITE | STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0, 0, lplpstg);
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index 37d0646153..c45e048f00 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -47,7 +47,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (lParam) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr((HWND)lParam, GWLP_USERDATA);
if (dat) {
- mir_sntprintf(szNewTitle, _countof(szNewTitle), TranslateT("Select container for %s"), dat->cache->getNick());
+ mir_sntprintf(szNewTitle, TranslateT("Select container for %s"), dat->cache->getNick());
SetWindowText(hwndDlg, szNewTitle);
}
}
@@ -178,7 +178,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
char szValue[10];
TContainerData *pContainer = 0;
do {
- mir_snprintf(szValue, _countof(szValue), "%d", iCounter);
+ mir_snprintf(szValue, "%d", iCounter);
if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 161431984b..508d2b7aa8 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -73,7 +73,7 @@ void CSendLaterJob::cleanDB()
db_set_dw(hContact, "SendLater", "count", iCount);
// delete flags
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_unset(hContact, "SendLater", szKey);
}
}
@@ -87,7 +87,7 @@ void CSendLaterJob::readFlags()
char szKey[100];
DWORD localFlags;
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
localFlags = db_get_dw(hContact, "SendLater", szKey, 0);
if (localFlags & SLF_SUSPEND)
@@ -104,7 +104,7 @@ void CSendLaterJob::writeFlags()
DWORD localFlags = (bCode == JOB_HOLD ? SLF_SUSPEND : 0);
char szKey[100];
- mir_snprintf(szKey, _countof(szKey), "$%s", szId);
+ mir_snprintf(szKey, "$%s", szId);
db_set_dw(hContact, "SendLater", szKey, localFlags);
}
}
@@ -130,12 +130,12 @@ CSendLaterJob::~CSendLaterJob()
_tcsncpy_s(ppd.lptzContactName, (tszName ? tszName : TranslateT("'(Unknown contact)'")), _TRUNCATE);
TCHAR *msgPreview = Utils::GetPreviewWithEllipsis(reinterpret_cast<TCHAR *>(&pBuf[mir_strlen((char *)pBuf) + 1]), 100);
if (fSuccess) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job completed successfully.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job completed successfully.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
else if (fFailed) {
- mir_sntprintf(ppd.lptzText, _countof(ppd.lptzText), TranslateT("A send later job failed to complete.\nThe original message: %s"),
+ mir_sntprintf(ppd.lptzText, TranslateT("A send later job failed to complete.\nThe original message: %s"),
msgPreview);
mir_free(msgPreview);
}
@@ -538,7 +538,7 @@ void CSendLater::qMgrFillList(bool fClear)
lvItem.mask = LVIF_TEXT | LVIF_PARAM;
TCHAR tszBuf[255];
- mir_sntprintf(tszBuf, _countof(tszBuf), _T("%s [%s]"), tszNick, c->getRealAccount());
+ mir_sntprintf(tszBuf, _T("%s [%s]"), tszNick, c->getRealAccount());
lvItem.pszText = tszBuf;
lvItem.cchTextMax = _countof(tszBuf);
lvItem.iItem = uIndex++;
@@ -590,7 +590,7 @@ void CSendLater::qMgrFillList(bool fClear)
bCode = p->bCode;
TCHAR tszStatus[20];
- mir_sntprintf(tszStatus, _countof(tszStatus), _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
+ mir_sntprintf(tszStatus, _T("X/%s[%c] (%d)"), tszStatusText, bCode, p->iSendCount);
tszStatus[0] = p->szId[0];
lvItem.pszText = tszStatus;
lvItem.iSubItem = 3;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 9824a8f5a8..dc6407bf1d 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -215,7 +215,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
if (iSendLength >= iMinLength) {
TCHAR tszError[256];
- mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
+ mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), iMinLength);
::SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError));
sendQueue->clearJob(iEntry);
return 0;
@@ -270,7 +270,7 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
size_t iSendLength = getSendLength(iEntry);
if (iSendLength >= dat->nMax) {
- mir_sntprintf(tszError, _countof(tszError), TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax);
+ mir_sntprintf(tszError, TranslateT("The message cannot be sent delayed or to multiple contacts, because it exceeds the maximum allowed message length of %d bytes"), dat->nMax);
SendMessage(dat->hwnd, DM_ACTIVATETOOLTIP, IDC_MESSAGE, LPARAM(tszError));
clearJob(iEntry);
return 0;
@@ -540,7 +540,7 @@ int SendQueue::ackMessage(TWindowData *dat, WPARAM wParam, LPARAM lParam)
SkinPlaySound("SendError");
TCHAR *szAckMsg = mir_a2t((char *)ack->lParam);
- mir_sntprintf(job.szErrorMsg, _countof(job.szErrorMsg), TranslateT("Delivery failure: %s"), szAckMsg);
+ mir_sntprintf(job.szErrorMsg, TranslateT("Delivery failure: %s"), szAckMsg);
job.iStatus = SQ_ERROR;
mir_free(szAckMsg);
KillTimer(dat->hwnd, TIMERID_MSGSEND + iFound);
@@ -679,10 +679,10 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, MCONTACT hContact, b
time_t now = time(0);
TCHAR tszTimestamp[30];
_tcsftime(tszTimestamp, _countof(tszTimestamp), _T("%Y.%m.%d - %H:%M"), _localtime32((__time32_t *)&now));
- mir_snprintf(szKeyName, _countof(szKeyName), "S%d", now);
- mir_sntprintf(tszHeader, _countof(tszHeader), TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
+ mir_snprintf(szKeyName, "S%d", now);
+ mir_sntprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
}
- else mir_sntprintf(tszHeader, _countof(tszHeader), _T("M%d|"), time(0));
+ else mir_sntprintf(tszHeader, _T("M%d|"), time(0));
T2Utf utf_header(tszHeader);
size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10;
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index da2f462594..9f06fa6957 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -108,7 +108,7 @@ int _DebugTraceW(const wchar_t *fmt, ...)
GetLocalTime(&st);
- mir_snprintf(tszTime, _countof(tszTime), "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
+ mir_snprintf(tszTime, "%02d.%02d.%04d - %02d:%02d:%02d.%04d: ", st.wDay, st.wMonth, st.wYear, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds);
mir_vsntprintf(debug, ibsize - 10, fmt, va);
@@ -120,7 +120,7 @@ int _DebugTraceW(const wchar_t *fmt, ...)
FILE *f;
CallService(MS_DB_GETPROFILEPATH, MAX_PATH, (LPARAM)szDataPath);
- mir_snprintf(szLogFileName, _countof(szLogFileName), "%s\\%s", szDataPath, "tabsrmm_debug.log");
+ mir_snprintf(szLogFileName, "%s\\%s", szDataPath, "tabsrmm_debug.log");
f = fopen(szLogFileName, "a+");
if (f) {
fputs(tszTime, f);
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 16eb8bcf4f..9021ba569c 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -686,7 +686,7 @@ void CThumbBase::renderBase()
wchar_t tszTemp[30];
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(tszTemp, _countof(tszTemp), TranslateT("%d unread"), m_dat->dwUnread);
+ mir_sntprintf(tszTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, tszTemp, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
}
m_rcIcon = m_rcTop;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 38e246a13c..0177193eb7 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -363,7 +363,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dat->dwFlags = MWF_LOG_ALL;
dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL);
dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE;
- mir_sntprintf(dat->szMyNickname, _countof(dat->szMyNickname), _T("My Nickname"));
+ mir_sntprintf(dat->szMyNickname, _T("My Nickname"));
StreamInEvents(hwndDlg, 0, 1, 0, &dbei);
SendDlgItemMessage(hwndDlg, IDC_PREVIEW, EM_SETSEL, -1, -1);
if (teInfo->changed)
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 62c9f2db30..05fb1ee579 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -193,7 +193,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, TWindowData *dat)
WritePrivateProfileStringA(fontBlocks[n].szBLockname, "Valid", "1", szIniFilename);
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(szAppname, fontBlocks[n].szIniTemp, firstIndex + i);
if (!db_get_s(NULL, szModule, szTemp, &dbv)) {
WritePrivateProfileStringA(szAppname, "Face", dbv.pszVal, szIniFilename);
db_free(&dbv);
@@ -274,7 +274,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
}
for (i = 0; i < fontBlocks[n].iCount; i++) {
mir_snprintf(szTemp, "Font%d", firstIndex + i);
- mir_snprintf(szAppname, _countof(szAppname), fontBlocks[n].szIniTemp, firstIndex + i);
+ mir_snprintf(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)
strncpy_s(szBuf, "Arial", _TRUNCATE);
@@ -425,7 +425,7 @@ const TCHAR* TSAPI GetThemeFileName(int iMode)
szFilename[0] = 0;
TCHAR filter[MAX_PATH];
- mir_sntprintf(filter, _countof(filter), _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
+ mir_sntprintf(filter, _T("%s%c*.tabsrmm%c%c"), TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 5179006977..a45aaa2923 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1212,7 +1212,7 @@ void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON &hIcon)
TCHAR szDrive[MAX_PATH], szDir[MAX_PATH], szImagePath[MAX_PATH];
_tsplitpath(m_tszFileName, szDrive, szDir, NULL, NULL);
- mir_sntprintf(szImagePath, _countof(szImagePath), _T("%s\\%s\\%s"), szDrive, szDir, buffer);
+ mir_sntprintf(szImagePath, _T("%s\\%s\\%s"), szDrive, szDir, buffer);
hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = NULL;
@@ -1241,12 +1241,12 @@ void CSkin::ReadItem(const int id, const TCHAR *szItem)
this_item->ALPHA = min(this_item->ALPHA, 100);
clr = RGB(GetBValue(defaults->COLOR), GetGValue(defaults->COLOR), GetRValue(defaults->COLOR));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color1"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR = HexStringToLong(buffer);
clr = RGB(GetBValue(defaults->COLOR2), GetGValue(defaults->COLOR2), GetRValue(defaults->COLOR2));
- mir_sntprintf(def_color, _countof(def_color), _T("%6.6x"), clr);
+ mir_sntprintf(def_color, _T("%6.6x"), clr);
GetPrivateProfileString(szItem, _T("Color2"), def_color, buffer, 400, m_tszFileName);
this_item->COLOR2 = HexStringToLong(buffer);
@@ -1316,7 +1316,7 @@ void CSkin::ReadImageItem(const TCHAR *itemname)
// handle the assignments of image items to skin items
for (int n = 0;; n++) {
- mir_sntprintf(szItemNr, _countof(szItemNr), _T("Item%d"), n);
+ mir_sntprintf(szItemNr, _T("Item%d"), n);
GetPrivateProfileString(itemname, szItemNr, _T("None"), buffer, 500, m_tszFileName);
if (!mir_tstrcmp(buffer, _T("None")))
break;
@@ -1481,7 +1481,7 @@ void CSkin::Load(void)
GetPrivateProfileString(_T("Theme"), _T("File"), _T("None"), buffer, MAX_PATH, m_tszFileName);
_tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
- mir_sntprintf(szFinalName, _countof(szFinalName), _T("%s\\%s\\%s"), szDrive, szPath, buffer);
+ mir_sntprintf(szFinalName, _T("%s\\%s\\%s"), szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
diff --git a/plugins/TabSRMM/src/themes.h b/plugins/TabSRMM/src/themes.h
index be8986039b..8f58735147 100644
--- a/plugins/TabSRMM/src/themes.h
+++ b/plugins/TabSRMM/src/themes.h
@@ -151,7 +151,7 @@ public:
CImageItem(const TCHAR *szName)
{
memset(this, 0, sizeof(CImageItem));
- mir_sntprintf(m_szName, _countof(m_szName), szName);
+ mir_sntprintf(m_szName, szName);
m_szName[39] = 0;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index a0954e031b..9db2c36379 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -90,7 +90,7 @@ static void TrayAnimThread(LPVOID)
void TSAPI CreateTrayMenus(int mode)
{
if (mode) {
- mir_sntprintf(g_eventName, _countof(g_eventName), _T("tsr_evt_%d"), GetCurrentThreadId());
+ mir_sntprintf(g_eventName, _T("tsr_evt_%d"), GetCurrentThreadId());
g_hEvent = CreateEvent(NULL, FALSE, FALSE, g_eventName);
isAnimThreadRunning = TRUE;
hTrayAnimThread = mir_forkthread(TrayAnimThread, NULL);
@@ -217,7 +217,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const TCHAR *szNickname, con
if (acc && acc->tszAccountName) {
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
- mir_sntprintf(szMenuEntry, _countof(szMenuEntry), _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
+ mir_sntprintf(szMenuEntry, _T("%s: %s (%s)"), acc->tszAccountName, szFinalNick, szStatus);
if (mode) {
if (hMenu == PluginConfig.g_hMenuRecent) {
if (CheckMenuItem(hMenu, (UINT_PTR)hContact, MF_BYCOMMAND | MF_UNCHECKED) == 0) {
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 6cbc66c579..083d35f76e 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -530,8 +530,8 @@ int TN_ModuleInit()
for (i = 0; i < _countof(colorPicker); i++)
colorPicker[i].color = M.GetDword(Module, colorPicker[i].desc, 0);
- mir_sntprintf(szStart, _countof(szStart), TranslateT("...is typing a message."));
- mir_sntprintf(szStop, _countof(szStop), TranslateT("...has stopped typing."));
+ mir_sntprintf(szStart, TranslateT("...is typing a message."));
+ mir_sntprintf(szStop, TranslateT("...has stopped typing."));
if (PluginConfig.g_bPopupAvail && ShowMenu) {
hTypingNotify = CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 1892993c53..403622be5e 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -152,7 +152,7 @@ search_again:
clr_found = true;
if (was_added) {
TCHAR wszTemp[100];
- mir_sntprintf(wszTemp, _countof(wszTemp), _T("##col##%06u:%04u"), endmark - closing, ii);
+ mir_sntprintf(wszTemp, _T("##col##%06u:%04u"), endmark - closing, ii);
wszTemp[99] = 0;
message.insert(beginmark, wszTemp);
}
@@ -645,7 +645,7 @@ void Utils::ReadPrivateContainerSettings(TContainerData *pContainer, bool fForce
char szCname[50];
TContainerSettings csTemp = { 0 };
- mir_snprintf(szCname, _countof(szCname), "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
+ mir_snprintf(szCname, "%s%d_Blob", CNT_BASEKEYNAME, pContainer->iContainerIndex);
Utils::ReadContainerSettingsFromDB(0, &csTemp, szCname);
if (csTemp.fPrivate || fForce) {
if (pContainer->settings == 0 || pContainer->settings == &PluginConfig.globalContainerSettings)
@@ -662,10 +662,10 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett
pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
if (pContainer->settings->fPrivate) {
- mir_snprintf(szCName, _countof(szCName), "%s%d_Blob", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_Blob", szSetting, pContainer->iContainerIndex);
WriteContainerSettingsToDB(0, pContainer->settings, szCName);
}
- mir_snprintf(szCName, _countof(szCName), "%s%d_theme", szSetting, pContainer->iContainerIndex);
+ mir_snprintf(szCName, "%s%d_theme", szSetting, pContainer->iContainerIndex);
if (mir_tstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
PathToRelativeT(pContainer->szRelThemeFile, pContainer->szAbsThemeFile, M.getDataPath());
@@ -897,7 +897,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const TCHAR *tszNam
DWORD dwSize = SizeofResource(g_hInst, hRes), written = 0;
TCHAR szFilename[MAX_PATH];
- mir_sntprintf(szFilename, _countof(szFilename), _T("%s%s"), tszPath, tszFilename);
+ mir_sntprintf(szFilename, _T("%s%s"), tszPath, tszFilename);
if (!fForceOverwrite)
if (PathFileExists(szFilename))
return true;