diff options
161 files changed, 504 insertions, 508 deletions
diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 8cd31b023b..5835213a5f 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA TranslateDialogDefault(hwndDlg); if (hContact) { TCHAR szTitle[512]; - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); + mir_sntprintf(szTitle, TranslateT("Set avatar options for %s"), pcli->pfnGetContactDisplayName(hContact, 0)); SetWindowText(hwndDlg, szTitle); } SendMessage(hwndDlg, DM_SETAVATARNAME, 0, 0); diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 621ac75fd6..207d5ee626 100644 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -140,9 +140,9 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TCHAR buff[100];
if (min >= 60)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%dh %dm"), min / 60, min % 60);
+ mir_sntprintf(buff, TranslateT("%dh %dm"), min / 60, min % 60);
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%dm"), min);
+ mir_sntprintf(buff, TranslateT("%dm"), min);
GetTextExtentPoint32(dis->hDC,buff,(int)mir_tstrlen(buff),&timeSize);
diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index aadf2a73a4..786b30c178 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -645,7 +645,7 @@ void EventList::AddImporter(MCONTACT hContact, IImport::ImportType type, const s mir_cslock lck(csEventList);
TCHAR buf[32];
- mir_sntprintf(buf, SIZEOF(buf), _T("%016llx"), (unsigned long long int)hContact);
+ mir_sntprintf(buf, _T("%016llx"), (unsigned long long int)hContact);
ImportDiscData data;
data.file = contactFileDir + buf;
data.type = type;
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 2ab17ec429..15656791ae 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -722,7 +722,7 @@ void SetEventCB(HWND hwndCB, int eventId) if (selCpIdx == -1) {
TCHAR buf[24];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), eventId);
+ mir_sntprintf(buf, _T("%d"), eventId);
ComboBox_SetText(hwndCB, buf);
}
else ComboBox_SetCurSel(hwndCB, selCpIdx);
@@ -777,7 +777,7 @@ void ReloadEventLB(HWND hwndLB, const FilterOptions &sel) if (selCpIdx == -1) {
TCHAR buf[24];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), *it);
+ mir_sntprintf(buf, _T("%d"), *it);
ListBox_AddString(hwndLB, buf);
}
else ListBox_AddString(hwndLB, TranslateTS(EventNames[selCpIdx].name));
@@ -1283,7 +1283,7 @@ void InitCodepageCB(HWND hwndCB, unsigned int codepage, const std::wstring& name if (selCpIdx == -1) {
TCHAR buf[300];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d;%s"), codepage, name.c_str());
+ mir_sntprintf(buf, _T("%d;%s"), codepage, name.c_str());
ComboBox_SetText(hwndCB, buf);
}
else ComboBox_SetCurSel(hwndCB, selCpIdx);
diff --git a/plugins/BasicHistory/src/PlainHtmlExport.cpp b/plugins/BasicHistory/src/PlainHtmlExport.cpp index 6ff0203124..635416695b 100644 --- a/plugins/BasicHistory/src/PlainHtmlExport.cpp +++ b/plugins/BasicHistory/src/PlainHtmlExport.cpp @@ -75,7 +75,7 @@ void PlainHtmlExport::WriteGroup(bool isMe, const std::wstring &time, const std: {
TCHAR buf[256];
EXP_FILE << _T("<div class=mes id=session>\n");
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Conversation started at %s"), time.c_str());
+ mir_sntprintf(buf, TranslateT("Conversation started at %s"), time.c_str());
EXP_FILE << _T("<div class=text>") << buf << _T("</div>\n");
EXP_FILE << _T("</div>\n");
}
diff --git a/plugins/BasicHistory/src/Searcher.cpp b/plugins/BasicHistory/src/Searcher.cpp index 88a7355350..f8f46cdc39 100644 --- a/plugins/BasicHistory/src/Searcher.cpp +++ b/plugins/BasicHistory/src/Searcher.cpp @@ -105,7 +105,7 @@ void Searcher::Find() GetWindowText(context->findWindow, str, SIZEOF(str));
if (!str[0]) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("\"%s\" not found"), str);
+ mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
return;
}
@@ -299,7 +299,7 @@ void Searcher::Find() if (isStart) {
TCHAR buf[256];
GetWindowText(context->findWindow, str, SIZEOF(str));
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("\"%s\" not found"), str);
+ mir_sntprintf(buf, TranslateT("\"%s\" not found"), str);
MessageBox(context->hWnd, buf, TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
}
else MessageBox(context->hWnd, TranslateTS(onlyGroup ? LPGENT("You have reached the end of the group.") : LPGENT("You have reached the end of the history.")), TranslateT("Search"), MB_OK | MB_ICONINFORMATION);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index a2000694d4..60bdd2084f 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -503,7 +503,7 @@ static TCHAR *GetBossKeyText(void) BYTE shift = HIBYTE(wHotKey);
static TCHAR buf[128] = { 0 };
- mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s%s%s"),
+ mir_sntprintf(buf, _T("%s%s%s%s%s"),
(shift & HOTKEYF_CONTROL) ? _T("Ctrl + ") : _T(""),
(shift & HOTKEYF_SHIFT) ? _T("Shift + ") : _T(""),
(shift & HOTKEYF_ALT) ? _T("Alt + ") : _T(""),
@@ -522,7 +522,7 @@ static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show t {
if (g_hMenuItem) {
TCHAR buf[128] = { 0 };
- mir_sntprintf(buf, SIZEOF(buf), _T("%s [%s]"), TranslateT("Hide"), GetBossKeyText());
+ mir_sntprintf(buf, _T("%s [%s]"), TranslateT("Hide"), GetBossKeyText());
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_FLAGS | CMIF_TCHAR | CMIM_NAME;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index a23b0cfad6..6460bdab29 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -131,7 +131,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: %s (%s)"), szwProto, szName, szStatus);
+ mir_sntprintf(szBuffer, _T("%s: %s (%s)"), szwProto, szName, szStatus);
szBuffer[127] = 0;
AppendMenu(g_CluiData.hMenuNotify, MF_BYCOMMAND | MF_STRING, g_CluiData.wNextMenuID, szBuffer);
mii.hbmpItem = HBMMENU_CALLBACK;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index c3a8f275a7..31f4e347f2 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -931,7 +931,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) static HICON CLUI_LoadIconFromExternalFile(TCHAR *filename, int i)
{
TCHAR szPath[MAX_PATH], szFullPath[MAX_PATH];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("Icons\\%s"), filename);
+ mir_sntprintf(szPath, _T("Icons\\%s"), filename);
PathToAbsoluteT(szPath, szFullPath);
if (_taccess(szPath, 0))
return NULL;
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp index 1ee8cad17d..92630786c4 100644 --- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp @@ -315,7 +315,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti) if (!cell->child)
{
if (cell->type == 0)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
+ mir_sntprintf(buf, TranslateT("Empty %s cell"), cell->cont == TC_COL ? TranslateT("column") : TranslateT("line"));
else
mir_tstrncpy(buf, TranslateTS(types[cell->type]), SIZEOF(buf));
}
@@ -324,7 +324,7 @@ void RefreshTree(HWND hwndDlg, HTREEITEM hti) if (cell->type == 0)
mir_tstrncpy(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), SIZEOF(buf));
else
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
+ mir_sntprintf(buf, TranslateT("%s, contain %s"), TranslateTS(types[cell->type]), cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines"));
}
if (cell->layer) mir_tstrncat(buf, TranslateT(" layered"), SIZEOF(buf) - mir_tstrlen(buf));
tvi.mask = TVIF_HANDLE | TVIF_TEXT;
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 1e6ff91483..23423c8df5 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -123,11 +123,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), sd->Name, Description, Author, Contact, URL, sd->File); } else { - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), + mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"), TranslateT("reVista for Modern v0.5"), TranslateT("This is second default Modern Contact list skin in Vista Aero style"), TranslateT("Angeli-Ka (graphics), FYR (template)"), @@ -279,11 +279,11 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File); GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File); GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File); - mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), + mir_sntprintf(text, TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"), sd->Name, Description, Author, Contact, URL); } else { - mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), + mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"), TranslateT("reVista for Modern v0.5"), TranslateT("This is second default Modern Contact list skin in Vista Aero style"), TranslateT("graphics by Angeli-Ka\ntemplate by FYR"), diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 7f5e2e6e3d..9c53205d4f 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -244,7 +244,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) int nEmails = (int)CallProtoService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
TCHAR buf[40];
- mir_sntprintf(buf, SIZEOF(buf), _T("[%d]"), nEmails);
+ mir_sntprintf(buf, _T("[%d]"), nEmails);
p->szProtoEMailCount = mir_tstrdup(buf);
}
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index e8d28ed80a..f776ccf551 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -501,7 +501,7 @@ static void UpdateFilters() T2Utf szBuf(szTempBuf);
mir_strncpy(g_szModename, szBuf, SIZEOF(g_szModename));
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Configuring view mode: %s"), szTempBuf);
+ mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index 9f5b3c85d5..47fe8121d9 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -284,7 +284,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) TCHAR szwProto[64];
MultiByteToWideChar(CP_ACP, 0, szProto, -1, szwProto, 64);
szwProto[63] = 0;
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: %s (%s)"), szwProto, szName, szStatus);
+ mir_sntprintf(szBuffer, _T("%s: %s (%s)"), szwProto, szName, szStatus);
szBuffer[127] = 0;
AppendMenu(cfg::dat.hMenuNotify, MF_BYCOMMAND | MF_STRING, cfg::dat.wNextMenuID, szBuffer);
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index e8ce910955..20ce9de27a 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -117,7 +117,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA DWORD dwFlags = cfg::getDword(hContact, "CList", "CLN_Flags", 0);
BYTE bSecondLine = cfg::getByte(hContact, "CList", "CLN_2ndline", -1);
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
+ mir_sntprintf(szTitle, TranslateT("Contact list display and ignore options for %s"), contact ? contact->szText : (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, hContact, GCDNF_TCHAR));
SetWindowText(hWnd, szTitle);
SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 7969de2489..8dc0bc718a 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -305,7 +305,7 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar #ifdef _WIN64
mir_sntprintf(buff,SIZEOF(buff),_T("%d.%d.%d.%d/64"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
#else
- mir_sntprintf(buff, SIZEOF(buff), _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
+ mir_sntprintf(buff, _T("%d.%d.%d.%d/32"), HIBYTE(HIWORD(pluginInfo.version)), LOBYTE(HIWORD(pluginInfo.version)), HIBYTE(LOWORD(pluginInfo.version)), LOBYTE(LOWORD(pluginInfo.version)));
#endif
SetDlgItemText(hwndDlg, IDC_VERSION, buff);
LoadSettings();
diff --git a/plugins/DbChecker/src/selectdb.cpp b/plugins/DbChecker/src/selectdb.cpp index ba0b1efa6c..65e5f69c67 100644 --- a/plugins/DbChecker/src/selectdb.cpp +++ b/plugins/DbChecker/src/selectdb.cpp @@ -114,7 +114,7 @@ static int AddDatabaseToList(HWND hwndList, const TCHAR* filename, TCHAR* dir) pName++;
TCHAR szName[MAX_PATH];
- mir_sntprintf(szName, SIZEOF(szName), _T("%s%s"), dir, pName);
+ mir_sntprintf(szName, _T("%s%s"), dir, pName);
TCHAR *pDot = _tcsrchr(szName, '.');
if (pDot != NULL && !mir_tstrcmpi(pDot, _T(".dat")))
diff --git a/plugins/FTPFileYM/src/dialog.cpp b/plugins/FTPFileYM/src/dialog.cpp index 8044cfd3a7..f15d6901be 100644 --- a/plugins/FTPFileYM/src/dialog.cpp +++ b/plugins/FTPFileYM/src/dialog.cpp @@ -307,11 +307,11 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0);
if (i < 3)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d minutes"), times[i]);
+ mir_sntprintf(buff, TranslateT("%d minutes"), times[i]);
else if (i < 7)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d hours"), times[i] / 60);
+ mir_sntprintf(buff, TranslateT("%d hours"), times[i] / 60);
else
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d days"), times[i] / 60 / 24);
+ mir_sntprintf(buff, TranslateT("%d days"), times[i] / 60 / 24);
UINT check = MF_UNCHECKED;
if (!bChecked && tab->iOptAutoDelete == times[i])
@@ -327,9 +327,9 @@ INT_PTR CALLBACK UploadDialog::UploadDlgProc(HWND hwndDlg, UINT msg, WPARAM wPar {
switch (opt.timeRange)
{
- case Options::TR_MINUTES: mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d minutes"), opt.iDeleteTime); break;
- case Options::TR_HOURS: mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d hours"), opt.iDeleteTime); break;
- case Options::TR_DAYS: mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d days"), opt.iDeleteTime); break;
+ case Options::TR_MINUTES: mir_sntprintf(buff, TranslateT("%d minutes"), opt.iDeleteTime); break;
+ case Options::TR_HOURS: mir_sntprintf(buff, TranslateT("%d hours"), opt.iDeleteTime); break;
+ case Options::TR_DAYS: mir_sntprintf(buff, TranslateT("%d days"), opt.iDeleteTime); break;
}
AppendMenu(hTimeMenu, MF_SEPARATOR, 0, 0);
diff --git a/plugins/FTPFileYM/src/job_generic.cpp b/plugins/FTPFileYM/src/job_generic.cpp index 21bddfc649..d8a680d5a1 100644 --- a/plugins/FTPFileYM/src/job_generic.cpp +++ b/plugins/FTPFileYM/src/job_generic.cpp @@ -46,7 +46,7 @@ GenericJob::~GenericJob() int GenericJob::openFileDialog()
{
TCHAR temp[MAX_PATH] = _T("");
- mir_sntprintf(temp, SIZEOF(temp), _T("%s\0*.*\0"), TranslateT("All Files (*.*)"));
+ mir_sntprintf(temp, _T("%s\0*.*\0"), TranslateT("All Files (*.*)"));
OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = 0;
diff --git a/plugins/FTPFileYM/src/job_packer.cpp b/plugins/FTPFileYM/src/job_packer.cpp index ba68c58f7e..11fe8c22fe 100644 --- a/plugins/FTPFileYM/src/job_packer.cpp +++ b/plugins/FTPFileYM/src/job_packer.cpp @@ -266,8 +266,8 @@ void PackerJob::updateStats() int m = (s - d * 60 * 60 * 24 - h * 60 * 60) / 60;
s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
- if (d > 0) mir_sntprintf(buff, SIZEOF(buff), _T("%dd %02d:%02d:%02d"), d, h, m, s);
- else mir_sntprintf(buff, SIZEOF(buff), _T("%02d:%02d:%02d"), h, m, s);
+ if (d > 0) mir_sntprintf(buff, _T("%dd %02d:%02d:%02d"), d, h, m, s);
+ else mir_sntprintf(buff, _T("%02d:%02d:%02d"), h, m, s);
mir_sntprintf(this->tab->stzRemain, SIZEOF(this->tab->stzRemain), TranslateT("%s (%d kB/%d kB)"), buff, (this->uiFileSize - this->uiReaded)/1024, this->uiFileSize/1024);
this->refreshTab(false);
diff --git a/plugins/FTPFileYM/src/job_upload.cpp b/plugins/FTPFileYM/src/job_upload.cpp index 506c704609..11601a67d4 100644 --- a/plugins/FTPFileYM/src/job_upload.cpp +++ b/plugins/FTPFileYM/src/job_upload.cpp @@ -248,7 +248,7 @@ INT_PTR CALLBACK UploadJob::DlgProcFileExists(HWND hwndDlg, UINT msg, WPARAM wPa {
TCHAR buff[256];
TCHAR *fileName = mir_a2t((char *)lParam);
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("File exists - %s"), fileName);
+ mir_sntprintf(buff, TranslateT("File exists - %s"), fileName);
SetWindowText(hwndDlg, buff);
FREE(fileName);
}
@@ -406,8 +406,8 @@ void UploadJob::updateStats() s = s - (d * 24 * 60 * 60) - (h * 60 * 60) - (m * 60);
TCHAR buff[256];
- if (d > 0) mir_sntprintf(buff, SIZEOF(buff), _T("%dd %02d:%02d:%02d"), d, h, m, s);
- else mir_sntprintf(buff, SIZEOF(buff), _T("%02d:%02d:%02d"), h, m, s);
+ if (d > 0) mir_sntprintf(buff, _T("%dd %02d:%02d:%02d"), d, h, m, s);
+ else mir_sntprintf(buff, _T("%02d:%02d:%02d"), h, m, s);
mir_sntprintf(this->tab->stzRemain, SIZEOF(this->tab->stzRemain), _T("%s (%d kB/%d kB)"), buff, (this->uiFileSize - this->uiTotalSent)/1024, this->uiFileSize/1024);
this->refreshTab(false);
diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index d89e8a4588..24ff38bc1e 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -334,7 +334,7 @@ bool bWriteConfigurationFile() { HANDLE hFile = CreateFile(szBuf, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE) {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), _T("%s%s"), TranslateT("Failed to open or create file "), _T(szConfigFile));
+ mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to open or create file "), _T(szConfigFile));
MessageBox(NULL, temp , MSG_BOX_TITEL, MB_OK);
return false;
}
@@ -342,7 +342,7 @@ bool bWriteConfigurationFile() { DWORD dwBytesWriten = 0;
if (! WriteFile(hFile, szXmlHeader, sizeof(szXmlHeader) - 1, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), _T("%s%s"), TranslateT("Failed to write xml header to file "), _T(szConfigFile));
+ mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml header to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
} else {
CLFileShareNode * pclCur = pclFirstNode;
@@ -356,7 +356,7 @@ bool bWriteConfigurationFile() { if (! WriteFile(hFile, szBuf, dwBytesToWrite, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), _T("%s%s"), TranslateT("Failed to write xml data to file "), _T(szConfigFile));
+ mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml data to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
break;
}
@@ -365,7 +365,7 @@ bool bWriteConfigurationFile() { if (! WriteFile(hFile, szXmlTail, sizeof(szXmlTail) - 1, &dwBytesWriten, NULL)) {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), _T("%s%s"), TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
+ mir_sntprintf(temp, _T("%s%s"), TranslateT("Failed to write xml tail to file "), _T(szConfigFile));
MessageBox(NULL, temp, MSG_BOX_TITEL, MB_OK);
}
}
diff --git a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp index 67a1a47e7f..aa80b1c799 100644 --- a/plugins/HistoryLinkListPlus/src/linklist_fct.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist_fct.cpp @@ -1254,7 +1254,7 @@ BOOL SaveEditAsStream( HWND hDlg ) ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
TCHAR temp[MAX_PATH];
- mir_sntprintf(temp, SIZEOF(temp), _T("%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c"), TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
+ mir_sntprintf(temp, _T("%s (*.rtf)%c*.rtf%c%s (*.*)%c*.*%c%c"), TranslateT("RTF file"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = temp;
ofn.lpstrFile = szFilename;
ofn.nMaxFile = SIZEOF(szFilename);
diff --git a/plugins/Import/src/miranda.cpp b/plugins/Import/src/miranda.cpp index 7cf271a2b3..eaf35058fb 100644 --- a/plugins/Import/src/miranda.cpp +++ b/plugins/Import/src/miranda.cpp @@ -50,7 +50,7 @@ static void SearchForLists(HWND hwndDlg, const TCHAR *mirandaPath, const TCHAR * continue;
TCHAR buf[MAX_PATH], profile[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\\%s\\%s.dat"), mirandaPath, fd.cFileName, fd.cFileName);
+ mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), mirandaPath, fd.cFileName, fd.cFileName);
if (_taccess(buf, 0) == 0) {
mir_sntprintf(profile, SIZEOF(profile), _T("%s.dat"), fd.cFileName);
@@ -123,7 +123,7 @@ INT_PTR CALLBACK MirandaPageProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM TCHAR str[MAX_PATH], text[256];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
- mir_sntprintf(text, SIZEOF(text), _T("%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c"), TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
+ mir_sntprintf(text, _T("%s (*.dat, *.bak)%c*.dat;*.bak%c%s (*.*)%c*.*%c%c"), TranslateT("Miranda NG database"), 0, 0, TranslateT("All Files"), 0, 0, 0);
OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 9002b5baab..27f038b856 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -191,7 +191,7 @@ void RebuildMenu() CallService(MO_REMOVEMENUITEM, (WPARAM) info->hMenu, 0);
TCHAR text[512];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Send to %s"), info->account);
+ mir_sntprintf(text, TranslateT("Send to %s"), info->account);
CLISTMENUITEM mi = { sizeof(mi) };
mi.position = 100000 + i;
@@ -243,7 +243,7 @@ int AccListChanged(WPARAM wParam, LPARAM lParam) mir_tstrncpy(info->account, proto->tszAccountName, SIZEOF(info->account));
TCHAR text[512];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Send to %s"), info->account);
+ mir_sntprintf(text, TranslateT("Send to %s"), info->account);
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
diff --git a/plugins/ListeningTo/src/players/generic.cpp b/plugins/ListeningTo/src/players/generic.cpp index ca9565b75f..d5da94ec7d 100644 --- a/plugins/ListeningTo/src/players/generic.cpp +++ b/plugins/ListeningTo/src/players/generic.cpp @@ -32,7 +32,7 @@ int m_log(const TCHAR *function, const TCHAR *fmt, ...) TCHAR text[1024];
size_t len;
- len = mir_sntprintf(text, SIZEOF(text), _T("[%08u - %08u] [%s] "),
+ len = mir_sntprintf(text, _T("[%08u - %08u] [%s] "),
GetCurrentThreadId(), GetTickCount(), function);
va_start(va, fmt);
diff --git a/plugins/MirOTR/src/dialogs.cpp b/plugins/MirOTR/src/dialogs.cpp index 350d761d8d..c688048302 100644 --- a/plugins/MirOTR/src/dialogs.cpp +++ b/plugins/MirOTR/src/dialogs.cpp @@ -182,14 +182,14 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA smp_for_contact[context->app_data].responder = data->responder; TCHAR buff[512], *proto = mir_a2t(GetContactProto(hContact)); - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); + mir_sntprintf(buff, TranslateT(LANG_SMP_VERIFY_TITLE), contact_get_nameT(hContact), proto); mir_free(proto); SetWindowText(hwndDlg, buff); SetDlgItemText(hwndDlg, IDC_STC_SMP_HEAD, buff); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)context); if (data->question) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -208,7 +208,7 @@ INT_PTR CALLBACK DlgSMPResponseProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA mir_free(data->question); } else { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_RESPOND_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -382,9 +382,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA } TCHAR buff[1024]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -488,9 +488,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA GetDlgItemText(hwndDlg, IDC_CBO_SMP_CHOOSE, buff, 255); if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_QUESTION), 255)==0) { if (trusted) - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPQUESTION_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -508,9 +508,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE); } else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_PASSWORD), 255)==0) { if (trusted) - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SMPPASSWORD_VERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -528,9 +528,9 @@ INT_PTR CALLBACK DlgProcSMPInitProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA ShowWindow(GetDlgItem(hwndDlg, IDNO), SW_HIDE); } else if (_tcsncmp(buff, TranslateT(LANG_SMPTYPE_FINGERPRINT), 255)==0) { if (trusted) - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); @@ -672,9 +672,9 @@ INT_PTR CALLBACK DlgBoxProcVerifyContext(HWND hwndDlg, UINT msg, WPARAM wParam, } TCHAR buff[512]; if (!fp->trust || fp->trust[0] == '\0') - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFY_DESC), contact_get_nameT(hContact)); else - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_FPVERIFIED_DESC), contact_get_nameT(hContact)); SetDlgItemText(hwndDlg, IDC_STC_SMP_INFO, buff); diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index 21ac240c25..697b0ba1c3 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -242,7 +242,7 @@ static unsigned int CALLBACK regen_key_thread(void* param) PROTOREGENKEYOPTIONS *opts = (PROTOREGENKEYOPTIONS *)param; TCHAR buff[512]; - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto); + mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_NEWKEY), opts->proto); EnableWindow(opts->refresh, FALSE); if (IDYES == MessageBox(opts->refresh, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION|MB_YESNO)) { char* proto = mir_t2a(opts->proto); @@ -363,7 +363,7 @@ static INT_PTR CALLBACK DlgProcMirOTROptsProto(HWND hwndDlg, UINT msg, WPARAM wP TCHAR buff_proto[128]; ListView_GetItemText(GetDlgItem(hwndDlg, IDC_LV_PROTO_PROTOS), sel, 0, buff_proto, SIZEOF(buff_proto)); TCHAR buff[512]; - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto); + mir_sntprintf(buff, TranslateT(LANG_OTR_ASK_REMOVEKEY), buff_proto); if (IDYES == MessageBox(hwndDlg, buff, TranslateT(LANG_OTR_INFO), MB_ICONQUESTION | MB_YESNO)) { char *proto = GetProtoName(lv, sel); if (proto == NULL) diff --git a/plugins/MirOTR/src/otr.cpp b/plugins/MirOTR/src/otr.cpp index 2bccd99338..cda80811eb 100644 --- a/plugins/MirOTR/src/otr.cpp +++ b/plugins/MirOTR/src/otr.cpp @@ -58,7 +58,7 @@ INT_PTR CALLBACK GenKeyDlgBoxProc(HWND hWndDlg, UINT msg, WPARAM wParam, LPARAM SetClassLongPtr(hWndDlg, GCLP_HICON, (LONG_PTR)LoadIcon(ICON_OTR, 1)); TCHAR buff[256]; TCHAR *proto = mir_a2t((char*)lParam); - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_GENERATE_KEY), proto); + mir_sntprintf(buff, TranslateT(LANG_GENERATE_KEY), proto); mir_free(proto); SetDlgItemText(hWndDlg, IDC_GENERATE, buff); GenKeyData *data = (GenKeyData *)mir_calloc(sizeof(GenKeyData)); @@ -170,14 +170,14 @@ extern "C" { SetEncryptionStatus(hContact, trusted); TCHAR buff[512]; if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_START_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } if (context->protocol_version < MIROTR_PROTO_LATEST){ size_t remaining = mir_tstrlen(buff); @@ -194,7 +194,7 @@ extern "C" { MCONTACT hContact = (MCONTACT)opdata; DEBUGOUT_T("OTR_GUI_GONE_INSECURE\n"); TCHAR buff[512]; - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(hContact)); //MessageBox(0, buff, Translate("OTR Information"), MB_OK); if (!Miranda_Terminated()) { ShowMessage(hContact, buff); @@ -214,27 +214,27 @@ extern "C" { TCHAR buff[1024]; if (!is_reply) { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { if (options.autoshow_verify) SMPInitDialog(context); //VerifyContextDialog(context); - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } // opdata is hContact ShowMessage(hContact, buff); } else { if (trusted == TRUST_PRIVATE) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR), contact_get_nameT(hContact)); } else if (trusted == TRUST_UNVERIFIED) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_HAS_CONTINUE_OTR_VERIFY), contact_get_nameT(hContact)); } else { // should never happen - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_NOT_STARTED_OTR), contact_get_nameT(hContact)); } } diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index 86a8e44a37..caf9fed357 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -57,12 +57,12 @@ INT_PTR SVC_StartOTR(WPARAM hContact, LPARAM lParam) hContact = hSub; if ( options.bHaveSecureIM && CallService("SecureIM/IsContactSecured", hContact, 0) != 0 ) { - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_OTR_SECUREIM_STARTED), contact_get_nameT(hContact)); ShowError(buff); return 0; } - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_REQUEST_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return StartOTR(hContact); @@ -82,7 +82,7 @@ INT_PTR SVC_RefreshOTR(WPARAM hContact, LPARAM lParam) return 0; } - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_TRY_CONTINUE_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); int res = StartOTR(hContact); @@ -116,7 +116,7 @@ INT_PTR SVC_StopOTR(WPARAM hContact, LPARAM lParam) SetEncryptionStatus(hContact, TRUST_NOT_PRIVATE); TCHAR buff[512]; - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_OTR), contact_get_nameT(hContact)); ShowMessage(hContact, buff); return 0; } diff --git a/plugins/MirOTR/src/svcs_proto.cpp b/plugins/MirOTR/src/svcs_proto.cpp index 637497350a..81a78e3005 100644 --- a/plugins/MirOTR/src/svcs_proto.cpp +++ b/plugins/MirOTR/src/svcs_proto.cpp @@ -112,7 +112,7 @@ INT_PTR SVC_OTRRecvMessage(WPARAM wParam,LPARAM lParam) if (tlv && !Miranda_Terminated()) { /* Notify the user that the other side disconnected. */ TCHAR buff[256]; - mir_sntprintf(buff, SIZEOF(buff), TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); + mir_sntprintf(buff, TranslateT(LANG_SESSION_TERMINATED_BY_OTR), contact_get_nameT(ccs->hContact)); SetEncryptionStatus(ccs->hContact, otr_context_get_trust(context)); // required since libotr 4!? ShowMessage(ccs->hContact, buff); } diff --git a/plugins/MirOTR/src/utils.cpp b/plugins/MirOTR/src/utils.cpp index 5414ab4568..7dbfc0a293 100644 --- a/plugins/MirOTR/src/utils.cpp +++ b/plugins/MirOTR/src/utils.cpp @@ -315,7 +315,7 @@ void ShowErrorUtf(char* msg) { void ShowMessageInline(const MCONTACT hContact, const TCHAR *msg) { TCHAR buff[1024]; - mir_sntprintf(buff, SIZEOF(buff), _T("%s%s"), _T(LANG_INLINE_PREFIX), msg); + mir_sntprintf(buff, _T("%s%s"), _T(LANG_INLINE_PREFIX), msg); T2Utf utf(buff); PROTORECVEVENT pre = {0}; diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 7147bab282..567a5402bf 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -135,7 +135,7 @@ void HookOnImport(HMODULE hModule, char *lpszImpModName, PVOID lpOrigFunc, PVOID TCHAR buf[200];
g_HookError = TRUE;
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
+ mir_sntprintf(buf, TranslateT("VirtualProtect failed. Code %d\nTry to call the author"), GetLastError());
prevMessageBox(0, buf, TranslateT("Error"), MB_OK);
}
}
diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index c17b1c5a75..619d97ed3c 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -992,7 +992,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, if (n != sPath.npos)
sPath.erase(0, n + 1);
- if (mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? _T("UTF8") : _T("ANSI"))) > 0)
+ if (mir_sntprintf(szTitle, szFormat, pszNick, sPath.c_str(), (pclDlg->bUtf8File ? _T("UTF8") : _T("ANSI"))) > 0)
SetWindowText(hwndDlg, szTitle);
}
diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 3b11046a5e..a0d5f2af53 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -350,7 +350,7 @@ BOOL bApplyChanges(HWND hwndDlg) int nTmp = GetDlgItemInt(hwndDlg, IDC_MAX_CLOUMN_WIDTH, &bTrans, TRUE);
if (!bTrans || nTmp < 5)
{
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Max line width must be at least %d"), 5);
+ mir_sntprintf(szTemp, TranslateT("Max line width must be at least %d"), 5);
MessageBox(hwndDlg, szTemp, MSG_BOX_TITEL, MB_OK);
bRet = false;
}
@@ -899,7 +899,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar ofn.hwndOwner = hwndDlg;
ofn.lpstrFile = szFile;
ofn.nMaxFile = SIZEOF(szFile);
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c"), TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
+ mir_sntprintf(buf, _T("%s (*.exe;*.com;*.bat;*.cmd)%c*.exe;*.com;*.bat;*.cmd%c%s (*.*)%c*.*%c%c"), TranslateT("Executable files"), 0, 0, TranslateT("All files"), 0, 0, 0);
ofn.lpstrFilter = buf;
ofn.nFilterIndex = 1;
//ofn.lpstrFileTitle = NULL;
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index ac9781fa49..acee271fea 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -235,7 +235,7 @@ void DisplayLastError(const TCHAR *pszError) DWORD error = GetLastError();
TCHAR szTemp[50];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\r\nErrorCode: %d\r\n"), error);
+ mir_sntprintf(szTemp, _T("\r\nErrorCode: %d\r\n"), error);
sError += szTemp;
sError += sGetErrorString(error);
MessageBox(NULL, sError.c_str(), MSG_BOX_TITEL, MB_OK);
@@ -651,7 +651,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) if (enRenameAction != eDAAutomatic)
{
tstring sRemoteUser = NickFromHandle(hContact);
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("File name for the user \"%s\" has changed!\n\nfrom:\t%s\nto:\t%s\n\nDo you wish to rename file?"),
sRemoteUser.c_str(),
sPrevFileName.c_str(),
@@ -672,7 +672,7 @@ tstring GetFilePathFromUser(MCONTACT hContact) while (!MoveFile(sPrevFileName.c_str(), sFilePath.c_str()))
{
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("Failed to rename file\n\nfrom:\t%s\nto:\t%s\n\nFailed with error: %s"),
sPrevFileName.c_str(),
sFilePath.c_str(),
@@ -1108,10 +1108,10 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) ReplaceAll(output, pszReplaceList[nCur], _DBGetString(hContact, sProto.c_str(), pszReplaceListA[nCur], _T("")));
}
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), db_get_dw(hContact, sProto.c_str(), "UIN", 0));
+ mir_sntprintf(szTemp, _T("%d"), db_get_dw(hContact, sProto.c_str(), "UIN", 0));
ReplaceAll(output, _T("%UIN%"), szTemp);
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), db_get_w(hContact, sProto.c_str(), "Age", 0));
+ mir_sntprintf(szTemp, _T("%d"), db_get_w(hContact, sProto.c_str(), "Age", 0));
ReplaceAll(output, _T("%Age%"), szTemp);
szTemp[0] = (TCHAR)db_get_b(hContact, sProto.c_str(), "Gender", 0);
@@ -1130,7 +1130,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) int nIndent;
{ // Get time stamp
- nIndent = mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%-*s"),
+ nIndent = mir_sntprintf(szTemp, _T("%-*s"),
nFirstColumnWidth,
dbei.flags & DBEF_SENT ? sLocalUser.c_str() : sRemoteUser.c_str());
@@ -1253,7 +1253,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) if (dbei.cbBlob < 8 || dbei.cbBlob > 5000)
{
- int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_sntprintf(szTemp, TranslateT("Invalid Database event received. Type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
DisplayErrorDialog(LPGENT("Failed to write Invalid Database event the file :\n"), sFilePath, &dbei);
break;
@@ -1284,7 +1284,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) bWriteTextToFile(hFile, LPGENT("UIN :"), bWriteUTF8Format))
{
DWORD uin = *((PDWORD)(dbei.pBlob));
- int n = mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%d"), uin);
+ int n = mir_sntprintf(szTemp, _T("%d"), uin);
if (bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
{
char *pszEnd = (char *)(dbei.pBlob + dbei.cbSize);
@@ -1372,7 +1372,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
default:
{
- int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
if (!bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n))
{
DisplayErrorDialog(LPGENT("Failed to write Unknown event to the file :\n"), sFilePath, &dbei);
@@ -1383,7 +1383,7 @@ void ExportDBEventInfo(MCONTACT hContact, DBEVENTINFO &dbei) }
else
{
- int n = mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
+ int n = mir_sntprintf(szTemp, TranslateT("Unknown event type %d, size %d"), dbei.eventType, dbei.cbBlob);
bWriteTextToFile(hFile, szTemp, bWriteUTF8Format, n);
}
bWriteToFile(hFile, bAppendNewLine ? "\r\n\r\n" : "\r\n");
@@ -1612,7 +1612,7 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) CloseHandle(hPrevFile);
TCHAR szTemp[500];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s\r\n%s"),
+ mir_sntprintf(szTemp, _T("%s\r\n%s"),
TranslateT("User has been deleted. Do you want to delete the file?"), sFilePath.c_str());
if (enDeleteAction == eDAAutomatic ||
@@ -1620,7 +1620,7 @@ int nContactDeleted(WPARAM wparam, LPARAM /*lparam*/) {
if (!DeleteFile(sFilePath.c_str()))
{
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
_T("%s\r\n%s"),
TranslateT("Failed to delete the file"),
sFilePath.c_str());
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index f8f56fe5fc..0cc739311a 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -304,7 +304,7 @@ void GetStatusText(MCONTACT hContact, WORD newStatus, WORD oldStatus, TCHAR *stz if (opt.ShowPreviousStatus) {
TCHAR buff[MAX_STATUSTEXT];
- mir_sntprintf(buff, SIZEOF(buff), TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
+ mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(oldStatus)].lpzStandardText);
mir_tstrcat(mir_tstrcat(stzStatusText, _T(" ")), buff);
}
}
@@ -631,11 +631,11 @@ int ProcessStatusMessage(DBCONTACTWRITESETTING *cws, MCONTACT hContact) //don't show popup when mradio connecting and disconnecting
if (_stricmp(szProto, "mRadio") == 0 && !cws->value.type == DBVT_DELETED) {
TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T(" (%s)"), TranslateT("connecting"));
+ mir_sntprintf(buf, _T(" (%s)"), TranslateT("connecting"));
T2Utf pszUtf(buf);
- mir_sntprintf(buf, SIZEOF(buf), _T(" (%s)"), TranslateT("aborting"));
+ mir_sntprintf(buf, _T(" (%s)"), TranslateT("aborting"));
T2Utf pszUtf2(buf);
- mir_sntprintf(buf, SIZEOF(buf), _T(" (%s)"), TranslateT("playing"));
+ mir_sntprintf(buf, _T(" (%s)"), TranslateT("playing"));
T2Utf pszUtf3(buf);
if (_stricmp(cws->value.pszVal, pszUtf) == 0 || _stricmp(cws->value.pszVal, pszUtf2) == 0 || _stricmp(cws->value.pszVal, pszUtf3) == 0)
goto skip_notify;
diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index fdd9a14aa3..3ce99eb21e 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -391,7 +391,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (opt.ShowPreviousStatus) {
TCHAR buff[MAX_STATUSTEXT];
- mir_sntprintf(buff, SIZEOF(buff), TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
+ mir_sntprintf(buff, TranslateTS(STRING_SHOWPREVIOUSSTATUS), StatusList[Index(i)].lpzStandardText);
mir_tstrcat(str, _T(" "));
mir_tstrcat(str, buff);
}
diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index 3b9f390634..bef246278a 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -257,7 +257,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM l) keyid = UniGetContactSettingUtf(NULL, szGPGModuleName, "KeyID", ""); } TCHAR buf[128] = {0}; - mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), TranslateT("Send public key"), toUTF16(keyid).c_str()); + mir_sntprintf(buf, _T("%s: %s"), TranslateT("Send public key"), toUTF16(keyid).c_str()); mir_free(keyid); mi2.ptszName = buf; mi2.flags = CMIM_NAME | CMIF_TCHAR; diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index ed4b314446..197d03623b 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -726,7 +726,7 @@ void Options::InitCodepageCB(HWND hwndCB, unsigned int codepage) if (selCpIdx == -1)
{
TCHAR buf[10];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), codepage);
+ mir_sntprintf(buf, _T("%d"), codepage);
ComboBox_SetText(hwndCB, buf);
}
else
@@ -750,7 +750,7 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) if (selCpIdx == -1)
{
TCHAR buf[10];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), codepage);
+ mir_sntprintf(buf, _T("%d"), codepage);
ComboBox_SetText(hwndCB, buf);
}
else
diff --git a/plugins/Ping/src/pinggraph.cpp b/plugins/Ping/src/pinggraph.cpp index 3dd8c82452..1947ada7bf 100644 --- a/plugins/Ping/src/pinggraph.cpp +++ b/plugins/Ping/src/pinggraph.cpp @@ -190,19 +190,19 @@ LRESULT CALLBACK GraphWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar TCHAR buff[64];
if (wd->show_grid)
{
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%d ms"), MARK_TIME);
+ mir_sntprintf(buff, TranslateT("%d ms"), MARK_TIME);
TextOut(hdc, r.right - 100, r.bottom - (int)(unit_height * MARK_TIME + 0.5f), buff, (int)mir_tstrlen(buff));
}
if (wd->show_stat)
{
SetTextColor(hdc, RGB(255, 0, 0));
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("AVG %.1lf ms"), avg);
+ mir_sntprintf(buff, TranslateT("AVG %.1lf ms"), avg);
TextOut(hdc, r.left + 10, r.bottom - (int)(avg * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
if (max_value != avg) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("MAX %hd ms"), max_value);
+ mir_sntprintf(buff, TranslateT("MAX %hd ms"), max_value);
TextOut(hdc, r.left + 10, r.bottom - (int)(max_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("MIN %hd ms"), min_value);
+ mir_sntprintf(buff, TranslateT("MIN %hd ms"), min_value);
TextOut(hdc, r.left + 10, r.bottom - (int)(min_value * unit_height + 0.5f), buff, (int)mir_tstrlen(buff));
}
}
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 16dde60f03..f5191a64e7 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -66,7 +66,7 @@ void SetProtoStatus(TCHAR *pszLabel, char *pszProto, int if_status, int new_stat if (CallProtoService(pszProto, PS_GETSTATUS, 0, 0) == if_status) {
if (options.logging) {
TCHAR buf[1024];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
+ mir_sntprintf(buf, TranslateT("%s - setting status of protocol '%S' (%d)"), pszLabel, pszProto, new_status);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
CallProtoService(pszProto, PS_SETSTATUS, new_status, 0);
@@ -198,7 +198,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) }
if (pa.miss_count == -1 - options.retries && options.logging) {
TCHAR buf[512];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
+ mir_sntprintf(buf, TranslateT("%s - reply, %d"), pa.pszLabel, pa.round_trip_time);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
SetProtoStatus(pa.pszLabel, pa.pszProto, pa.get_status, pa.set_status);
@@ -214,7 +214,7 @@ void __cdecl sttCheckStatusThreadProc(void *vp) }
if (pa.miss_count == 1 + options.retries && options.logging) {
TCHAR buf[512];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s - timeout"), pa.pszLabel);
+ mir_sntprintf(buf, TranslateT("%s - timeout"), pa.pszLabel);
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
}
@@ -410,12 +410,12 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (itemData.status != PS_DISABLED) {
TCHAR buf[256];
if (itemData.responding) {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%d ms"), itemData.round_trip_time);
+ mir_sntprintf(buf, TranslateT("%d ms"), itemData.round_trip_time);
GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
}
else if (itemData.miss_count > 0) {
- mir_sntprintf(buf, SIZEOF(buf), _T("[%d]"), itemData.miss_count);
+ mir_sntprintf(buf, _T("[%d]"), itemData.miss_count);
GetTextExtentPoint32(dis->hDC, buf, (int)mir_tstrlen(buf), &textSize);
TextOut(dis->hDC, dis->rcItem.right - textSize.cx - 2, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, buf, (int)mir_tstrlen(buf));
}
@@ -777,7 +777,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar if (options.logging) {
TCHAR buf[1024];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s - %s"), pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
+ mir_sntprintf(buf, _T("%s - %s"), pItemData->pszLabel, (wake ? TranslateT("enabled") : TranslateT("double clicked")));
CallService(PLUG "/Log", (WPARAM)buf, 0);
}
diff --git a/plugins/Scriver/src/chat/tools.cpp b/plugins/Scriver/src/chat/tools.cpp index 52a474df61..c099d50a83 100644 --- a/plugins/Scriver/src/chat/tools.cpp +++ b/plugins/Scriver/src/chat/tools.cpp @@ -63,7 +63,7 @@ UINT CreateGCMenu(HWND hwnd, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO *s else if (iIndex == 0) {
TCHAR szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
+ mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp index bad5e0c81c..638c8feb85 100644 --- a/plugins/Scriver/src/chat/window.cpp +++ b/plugins/Scriver/src/chat/window.cpp @@ -1181,17 +1181,17 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR switch (si->iType) {
case GCW_CHATROOM:
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user)") : TranslateT("%s: chat room (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_PRIVMESS:
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: message session") : TranslateT("%s: message session (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_SERVER:
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s: Server"), si->ptszName);
+ mir_sntprintf(szTemp, _T("%s: Server"), si->ptszName);
break;
}
tbd.iFlags = TBDF_TEXT | TBDF_ICON;
@@ -1204,7 +1204,7 @@ static INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR {
MODULEINFO *mi = pci->MM_FindModule(si->pszModule);
hIcon = si->wStatus == ID_STATUS_ONLINE ? mi->hOnlineIcon : mi->hOfflineIcon;
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s : %s"), mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : _T(""));
+ mir_sntprintf(szTemp, _T("%s : %s"), mi->ptszModDispName, si->ptszStatusbarText ? si->ptszStatusbarText : _T(""));
StatusBarData sbd;
sbd.iItem = 0;
diff --git a/plugins/Scriver/src/infobar.cpp b/plugins/Scriver/src/infobar.cpp index 301ab1f909..1aa9bfcae4 100644 --- a/plugins/Scriver/src/infobar.cpp +++ b/plugins/Scriver/src/infobar.cpp @@ -84,7 +84,7 @@ void RefreshInfobar(InfobarWindowData* idat) TCHAR szText[2048];
SETTEXTEX st;
if ( szXStatusMsg && *szXStatusMsg )
- mir_sntprintf(szText, SIZEOF(szText), _T("%s (%s)"), TranslateTS(szXStatusName), szXStatusMsg);
+ mir_sntprintf(szText, _T("%s (%s)"), TranslateTS(szXStatusName), szXStatusMsg);
else
_tcsncpy_s(szText, TranslateTS(szXStatusName), _TRUNCATE);
st.flags = ST_DEFAULT;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 14d5606ac9..40ba1f0732 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -166,12 +166,12 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFil if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\*"), szFilename);
+ mir_sntprintf(szPath, _T("%s\\*"), szFilename);
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
if (!mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T(".."))) continue;
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s"), szFilename, fd.cFileName);
+ mir_sntprintf(szPath, _T("%s\\%s"), szFilename, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
} while (FindNextFile(hFind, &fd));
FindClose(hFind);
@@ -561,7 +561,7 @@ static void UpdateReadChars(HWND hwndDlg, SrmmWindowData *dat) sbd.iFlags = SBDF_TEXT | SBDF_ICON;
sbd.hIcon = NULL;
sbd.pszText = szText;
- mir_sntprintf(szText, SIZEOF(szText), _T("%d"), len);
+ mir_sntprintf(szText, _T("%d"), len);
SendMessage(dat->hwndParent, CM_UPDATESTATUSBAR, (WPARAM)&sbd, (LPARAM)hwndDlg);
}
}
@@ -1360,13 +1360,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (dat->messagesInProgress && (g_dat.flags & SMF_SHOWPROGRESS)) {
sbd.hIcon = GetCachedIcon("scriver_DELIVERING");
sbd.pszText = szText;
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress);
+ mir_sntprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), dat->messagesInProgress);
}
else if (dat->nTypeSecs) {
TCHAR *szContactName = GetNickname(dat->hContact, dat->szProto);
sbd.hIcon = GetCachedIcon("scriver_TYPING");
sbd.pszText = szText;
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("%s is typing a message..."), szContactName);
+ mir_sntprintf(szText, TranslateT("%s is typing a message..."), szContactName);
mir_free(szContactName);
dat->nTypeSecs--;
}
@@ -1374,7 +1374,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP TCHAR date[64], time[64];
tmi.printTimeStamp(NULL, dat->lastMessage, _T("d"), date, SIZEOF(date), 0);
tmi.printTimeStamp(NULL, dat->lastMessage, _T("t"), time, SIZEOF(time), 0);
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Last message received on %s at %s."), date, time);
+ mir_sntprintf(szText, TranslateT("Last message received on %s at %s."), date, time);
sbd.pszText = szText;
}
else sbd.pszText = _T("");
diff --git a/plugins/Scriver/src/msgtimedout.cpp b/plugins/Scriver/src/msgtimedout.cpp index 79915a1e22..0238bc5806 100644 --- a/plugins/Scriver/src/msgtimedout.cpp +++ b/plugins/Scriver/src/msgtimedout.cpp @@ -50,7 +50,7 @@ INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar SendDlgItemMessage(hwndDlg, IDC_MSGTEXT, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)ewd->szText);
}
if (ewd->szName)
- mir_sntprintf(szText, SIZEOF(szText), _T("%s - %s"), TranslateT("Send error"), ewd->szName);
+ mir_sntprintf(szText, _T("%s - %s"), TranslateT("Send error"), ewd->szName);
else
_tcsncpy_s(szText, TranslateT("Send error"), _TRUNCATE);
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index fcc879976a..023e3e37c4 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1489,7 +1489,7 @@ static int ChangeStatusMsgPrebuild(WPARAM wParam, LPARAM lParam) TCHAR szBuffer[256];
if (CallService(MS_PROTO_ISACCOUNTLOCKED,0,(LPARAM)pa[i]->szModuleName))
{
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s (locked)"), pa[i]->tszAccountName);
+ mir_sntprintf(szBuffer, TranslateT("%s (locked)"), pa[i]->tszAccountName);
mi.ptszPopupName = szBuffer;
}
else
diff --git a/plugins/SimpleStatusMsg/src/msgbox.cpp b/plugins/SimpleStatusMsg/src/msgbox.cpp index 3faaa205aa..99e15d99df 100644 --- a/plugins/SimpleStatusMsg/src/msgbox.cpp +++ b/plugins/SimpleStatusMsg/src/msgbox.cpp @@ -275,12 +275,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) else if (data->m_iDlgFlags & DLG_SHOW_BUTTONS_INLIST) { if (found) { if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, SIZEOF(text), TranslateT("Clear history")); + mir_sntprintf(text, TranslateT("Clear history")); cbei.iImage = I_ICON_CLEAR; cbei.iSelectedImage = I_ICON_CLEAR; } else { - mir_sntprintf(text, SIZEOF(text), _T("## %s ##"), TranslateT("Clear history")); + mir_sntprintf(text, _T("## %s ##"), TranslateT("Clear history")); cbei.iIndent = 1; } cbei.iItem = -1; @@ -292,12 +292,12 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) cbei.iItem = -1; if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, SIZEOF(text), TranslateT("Add to predefined")); + mir_sntprintf(text, TranslateT("Add to predefined")); cbei.iImage = I_ICON_ADD; cbei.iSelectedImage = I_ICON_ADD; } else { - mir_sntprintf(text, SIZEOF(text), _T("## %s ##"), TranslateT("Add to predefined")); + mir_sntprintf(text, _T("## %s ##"), TranslateT("Add to predefined")); cbei.iIndent = 1; } cbei.pszText = (LPTSTR)text; @@ -306,13 +306,13 @@ HWND WINAPI CreateRecentComboBoxEx(HWND hwndDlg, struct MsgBoxData *data) SendMessage(handle, CBEM_INSERTITEM, 0, (LPARAM)&cbei); if (data->m_iDlgFlags & DLG_SHOW_LIST_ICONS) { - mir_sntprintf(text, SIZEOF(text), TranslateT("Delete selected")); + mir_sntprintf(text, TranslateT("Delete selected")); cbei.iImage = I_ICON_DEL; cbei.iSelectedImage = I_ICON_DEL; } else { cbei.iIndent = 1; - mir_sntprintf(text, SIZEOF(text), _T("## %s ##"), TranslateT("Delete selected")); + mir_sntprintf(text, _T("## %s ##"), TranslateT("Delete selected")); } cbei.iItem = -1; cbei.pszText = (LPTSTR)text; @@ -783,9 +783,9 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) mir_sntprintf(szProtoName, SIZEOF(szProtoName), msgbox_data->m_szProto ? ProtoGetAccount(msgbox_data->m_szProto)->tszAccountName : TranslateT("global")); if (iStatus == ID_STATUS_CURRENT) { if (msgbox_data->m_bOnStartup) - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); + mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<startup>"), szProtoName); else - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName); + mir_sntprintf(szTitle, TranslateT("%s message (%s)"), TranslateT("<current>"), szProtoName); } else if (iStatus > ID_STATUS_CURRENT) { TCHAR buff[128]; @@ -794,10 +794,10 @@ void ChangeDlgStatus(HWND hwndDlg, struct MsgBoxData *msgbox_data, int iStatus) CallService(MS_SS_GETPROFILENAME, iStatus - 40083, (LPARAM)buff1); MultiByteToWideChar(CallService(MS_LANGPACK_GETCODEPAGE, 0, 0), 0, buff1, -1, buff, 128); - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("%s message (%s)"), (TCHAR *)buff, szProtoName); + mir_sntprintf(szTitle, TranslateT("%s message (%s)"), (TCHAR *)buff, szProtoName); } else - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName); + mir_sntprintf(szTitle, TranslateT("%s message (%s)"), pcli->pfnGetStatusModeDescription(iStatus, 0), szProtoName); SetWindowText(hwndDlg, szTitle); if (iStatus == ID_STATUS_CURRENT) @@ -909,12 +909,12 @@ INT_PTR CALLBACK AwayMsgBoxDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA if (init_data->m_iStatus == ID_STATUS_CURRENT) { if (init_data->m_bOnStartup) - mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, TranslateT("<startup>"), szProtoName); + mir_sntprintf(szTitle, szFormat, TranslateT("<startup>"), szProtoName); else - mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, TranslateT("<current>"), szProtoName); + mir_sntprintf(szTitle, szFormat, TranslateT("<current>"), szProtoName); } else - mir_sntprintf(szTitle, SIZEOF(szTitle), szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName); + mir_sntprintf(szTitle, szFormat, pcli->pfnGetStatusModeDescription(init_data->m_iStatus, 0), szProtoName); SetWindowText(hwndDlg, szTitle); int icoStatus = ID_STATUS_OFFLINE; diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index 0c19914ee0..44208ff54c 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -1251,7 +1251,7 @@ static INT_PTR CALLBACK DlgAdvancedOptionsProc(HWND hwndDlg, UINT uMsg, WPARAM w if (!ServiceExists(MS_SS_GETPROFILECOUNT)) {
TCHAR szText[100];
- mir_sntprintf(szText, SIZEOF(szText), _T("%s *"), TranslateT("Show status profiles in status list"));
+ mir_sntprintf(szText, _T("%s *"), TranslateT("Show status profiles in status list"));
SetDlgItemText(hwndDlg, IDC_CPROFILES, szText);
EnableWindow(GetDlgItem(hwndDlg, IDC_CPROFILES), FALSE);
ShowWindow(GetDlgItem(hwndDlg, IDC_NOTE1), SW_SHOW);
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index fd8d00c01a..10301d536c 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -437,17 +437,17 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA EnableControlsBayes(optDlg, bEnabled);
- mir_sntprintf(buf, SIZEOF(buf), _T("%0.02f"), (double)_getOptD("BayesSpamScore", defaultBayesSpamScore)*SCORE_C);
+ mir_sntprintf(buf, _T("%0.02f"), (double)_getOptD("BayesSpamScore", defaultBayesSpamScore)*SCORE_C);
SetDlgItemText(optDlg, IDC_OPT_BAYES_SPAM_SCORE, buf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%.02f"), (double)_getOptD("BayesHamScore", defaultBayesHamScore)*SCORE_C);
+ mir_sntprintf(buf, _T("%.02f"), (double)_getOptD("BayesHamScore", defaultBayesHamScore)*SCORE_C);
SetDlgItemText(optDlg, IDC_OPT_BAYES_HAM_SCORE, buf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), _getOptD("BayesWaitApprove", defaultBayesWaitApprove));
+ mir_sntprintf(buf, _T("%d"), _getOptD("BayesWaitApprove", defaultBayesWaitApprove));
SetDlgItemText(optDlg, IDC_OPT_BAYES_WAIT_APPROVE, buf);
if (bEnabled) {
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(SPAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(HAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
}
@@ -491,9 +491,9 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, _T(""));
free(dbuf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(SPAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(HAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
return FALSE;
@@ -508,9 +508,9 @@ INT_PTR CALLBACK DlgProcOptionsBayes(HWND optDlg, UINT msg, WPARAM wParam, LPARA SetDlgItemText(optDlg, IDC_OPT_BAYES_LEARNBOX, _T(""));
free(dbuf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(SPAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(SPAM));
SetDlgItemText(optDlg, IDC_STATIC_SPAM_COUNT, buf);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), get_msg_count(HAM));
+ mir_sntprintf(buf, _T("%d"), get_msg_count(HAM));
SetDlgItemText(optDlg, IDC_STATIC_HAM_COUNT, buf);
return FALSE;
diff --git a/plugins/SpellChecker/src/utils.cpp b/plugins/SpellChecker/src/utils.cpp index ba907461ab..f985951c90 100644 --- a/plugins/SpellChecker/src/utils.cpp +++ b/plugins/SpellChecker/src/utils.cpp @@ -518,7 +518,7 @@ LRESULT CALLBACK OwnerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) int errors = TimerCheck(dlg, TRUE);
if (errors > 0) {
TCHAR text[500];
- mir_sntprintf(text, SIZEOF(text), TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
+ mir_sntprintf(text, TranslateT("There are %d spelling errors. Are you sure you want to send this message?"), errors);
if (MessageBox(hwnd, text, TranslateT("Spell Checker"), MB_ICONQUESTION | MB_YESNO) == IDNO)
return TRUE;
}
@@ -1134,7 +1134,7 @@ void AddMenuForWord(Dialog *dlg, TCHAR *word, CHARRANGE &pos, HMENU hMenu, BOOL InsertMenu(hMenu, 0, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Wrong word: %s"), word);
+ mir_sntprintf(text, TranslateT("Wrong word: %s"), word);
InsertMenu(hMenu, 0, MF_BYPOSITION, 0, text);
}
}
diff --git a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp index 668b2cceea..b45f796a4c 100644 --- a/plugins/StatusPlugins/KeepStatus/keepstatus.cpp +++ b/plugins/StatusPlugins/KeepStatus/keepstatus.cpp @@ -894,7 +894,7 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s connected from another location"), GetHumanName(lParam)); + mir_sntprintf(text, TranslateT("%s connected from another location"), GetHumanName(lParam)); break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto @@ -903,9 +903,9 @@ static int ProcessPopup(int reason, LPARAM lParam) hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) - mir_sntprintf(text, SIZEOF(text), TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); + mir_sntprintf(text, TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); else if (db_get_b(NULL, MODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - mir_sntprintf(text, SIZEOF(text), TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + mir_sntprintf(text, TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(NULL, MODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; @@ -916,9 +916,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { // Óêàçàòåëü íà èìÿ ìîäóëÿ. hIcon = LoadSkinnedProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); + mir_sntprintf(text, TranslateT("%s status error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, currentDelay / 1000); } - else mir_sntprintf(text, SIZEOF(text), TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); + else mir_sntprintf(text, TranslateT("Status error (next retry (%d) in %d s)"), retryCount + 1, currentDelay / 1000); break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** @@ -942,9 +942,9 @@ static int ProcessPopup(int reason, LPARAM lParam) rtrimt(protoInfo); if (retryCount == (maxRetries - 1)) - mir_sntprintf(text, SIZEOF(text), TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); + mir_sntprintf(text, TranslateT("Resetting status... (last try (%d))%s"), retryCount + 1, protoInfo); else - mir_sntprintf(text, SIZEOF(text), TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); + mir_sntprintf(text, TranslateT("Resetting status... (next retry (%d) in %d s)%s"), retryCount + 2, currentDelay / 1000, protoInfo); } break; @@ -953,9 +953,9 @@ static int ProcessPopup(int reason, LPARAM lParam) return -1; if (retryCount == maxRetries - 1) - mir_sntprintf(text, SIZEOF(text), TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); + mir_sntprintf(text, TranslateT("No internet connection seems available... (last try (%d))"), retryCount + 1); else - mir_sntprintf(text, SIZEOF(text), TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); + mir_sntprintf(text, TranslateT("No internet connection seems available... (next retry (%d) in %d s)"), retryCount + 2, currentDelay / 1000); break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes @@ -964,9 +964,9 @@ static int ProcessPopup(int reason, LPARAM lParam) if (lParam) { hIcon = LoadSkinnedIcon(SKINICON_STATUS_ONLINE); - mir_sntprintf(text, SIZEOF(text), TranslateT("Status was set ok")); + mir_sntprintf(text, TranslateT("Status was set ok")); } - else mir_sntprintf(text, SIZEOF(text), TranslateT("Giving up")); + else mir_sntprintf(text, TranslateT("Giving up")); break; } if (hIcon == NULL) diff --git a/plugins/StatusPlugins/StartupStatus/options.cpp b/plugins/StatusPlugins/StartupStatus/options.cpp index 64d1a63444..19032f1316 100644 --- a/plugins/StatusPlugins/StartupStatus/options.cpp +++ b/plugins/StatusPlugins/StartupStatus/options.cpp @@ -322,12 +322,12 @@ static INT_PTR CALLBACK StartupStatusOptDlgProc(HWND hwndDlg,UINT msg,WPARAM wPa }
else {
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), TranslateT("size: %d x %d"),
+ mir_sntprintf(text, TranslateT("size: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_WIDTH, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_HEIGHT, 0));
SetDlgItemText(hwndDlg, IDC_CURWINSIZE, text);
- mir_sntprintf(text, SIZEOF(text), TranslateT("loc: %d x %d"),
+ mir_sntprintf(text, TranslateT("loc: %d x %d"),
db_get_dw(NULL, MODULE_CLIST, SETTING_XPOS, 0),
db_get_dw(NULL, MODULE_CLIST, SETTING_YPOS, 0));
SetDlgItemText(hwndDlg, IDC_CURWINLOC, text);
diff --git a/plugins/StatusPlugins/confirmdialog.cpp b/plugins/StatusPlugins/confirmdialog.cpp index 543bbc0f20..03b9943ca2 100644 --- a/plugins/StatusPlugins/confirmdialog.cpp +++ b/plugins/StatusPlugins/confirmdialog.cpp @@ -127,11 +127,11 @@ static int SetStatusList(HWND hwndDlg) TCHAR* status = pcli->pfnGetStatusModeDescription(actualStatus, 0);
switch ((*confirmSettings)[i].status) {
case ID_STATUS_LAST:
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT("<last>"), status);
+ mir_sntprintf(buf, _T("%s (%s)"), TranslateT("<last>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
case ID_STATUS_CURRENT:
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT("<current>"), status);
+ mir_sntprintf(buf, _T("%s (%s)"), TranslateT("<current>"), status);
ListView_SetItemText(hList, lvItem.iItem, 1, buf);
break;
default:
@@ -210,7 +210,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // start timer
if (timeOut > 0) {
TCHAR text[32];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut);
+ mir_sntprintf(text, TranslateT("Closing in %d"), timeOut);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
SetTimer(hwndDlg, TIMER_ID, 1000, NULL);
}
@@ -219,7 +219,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP case WM_TIMER:
{
TCHAR text[32];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Closing in %d"), timeOut - 1);
+ mir_sntprintf(text, TranslateT("Closing in %d"), timeOut - 1);
SetDlgItemText(hwndDlg, IDC_CLOSE, text);
if (timeOut <= 0) {
KillTimer(hwndDlg, TIMER_ID);
@@ -344,7 +344,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // last
TCHAR buf[100];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
+ mir_sntprintf(buf, _T("%s (%s)"), TranslateT("<last>"), pcli->pfnGetStatusModeDescription(proto->lastStatus, 0));
int item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_LAST);
if (proto->status == ID_STATUS_LAST) {
@@ -354,7 +354,7 @@ static INT_PTR CALLBACK ConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP // current
int currentStatus = CallProtoService(proto->szName, PS_GETSTATUS, 0, 0);
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
+ mir_sntprintf(buf, _T("%s (%s)"), TranslateT("<current>"), pcli->pfnGetStatusModeDescription(currentStatus, 0));
item = SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_ADDSTRING, 0, (LPARAM)buf);
SendDlgItemMessage(hwndDlg, IDC_STATUS, CB_SETITEMDATA, item, ID_STATUS_CURRENT);
if (proto->status == ID_STATUS_CURRENT) {
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp index 55bfc761b6..86cb4817cc 100644 --- a/plugins/TabSRMM/src/chat/log.cpp +++ b/plugins/TabSRMM/src/chat/log.cpp @@ -115,7 +115,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** szTemp3[1] = line[2];
szTemp3[2] = '\0';
col = _ttoi(szTemp3);
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%%c#%02X%02X%02X"), c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
+ mir_sntprintf(szTemp, _T("%%%c#%02X%02X%02X"), c, GetRValue(mi->crColors[col]), GetGValue(mi->crColors[col]), GetBValue(mi->crColors[col]));
}
}
line += 2;
@@ -123,7 +123,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** case 'C':
case 'F':
if (!g_Settings.bStripFormat && !streamData->bStripFormat) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%%c"), *line);
+ mir_sntprintf(szTemp, _T("%%%c"), *line);
}
break;
case 'b':
@@ -134,7 +134,7 @@ static int Log_AppendIEView(LOGSTREAMDATA* streamData, BOOL simpleMode, TCHAR ** case 'I':
case 'r':
if (!streamData->bStripFormat) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%%c"), *line);
+ mir_sntprintf(szTemp, _T("%%%c"), *line);
}
break;
}
@@ -542,7 +542,7 @@ static void AddEventToBuffer(CMStringA &str, LOGSTREAMDATA *streamData) _tcsncpy_s(szTemp2, szTemp, _TRUNCATE);
if (streamData->lin->ptszUserInfo && streamData->lin->iType != GC_EVENT_TOPIC)
- 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/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp index 46c67ba0a1..8fcecf9662 100644 --- a/plugins/TabSRMM/src/chat/services.cpp +++ b/plugins/TabSRMM/src/chat/services.cpp @@ -37,7 +37,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
if ((pContainer = FindMatchingContainer(_T("default"))) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
- mir_sntprintf(szName, SIZEOF(szName), _T("default"));
+ mir_sntprintf(szName, _T("default"));
if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp index 6bb9e78f08..c0aea1f488 100644 --- a/plugins/TabSRMM/src/chat/tools.cpp +++ b/plugins/TabSRMM/src/chat/tools.cpp @@ -545,7 +545,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO else if (iIndex == 0) {
TCHAR szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
+ mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
_tcsncpy_s(szTemp, TranslateT("&Message"), _TRUNCATE);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp index ae45ebdf77..c062388cb6 100644 --- a/plugins/TabSRMM/src/chat/window.cpp +++ b/plugins/TabSRMM/src/chat/window.cpp @@ -1901,19 +1901,19 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar switch (si->iType) { case GCW_CHATROOM: hIcon = LoadSkinnedProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus); - mir_sntprintf(szTemp, SIZEOF(szTemp), + mir_sntprintf(szTemp, (si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user%s)") : TranslateT("%s: chat room (%u users%s)"), szNick, si->nUsersInNicklist, si->bFilterEnabled ? TranslateT(", event filter active") : _T("")); break; case GCW_PRIVMESS: hIcon = LoadSkinnedProtoIcon(si->pszModule, (dat->wStatus <= ID_STATUS_OFFLINE) ? ID_STATUS_OFFLINE : dat->wStatus); if (si->nUsersInNicklist == 1) - mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s: message session"), szNick); + mir_sntprintf(szTemp, TranslateT("%s: message session"), szNick); else - mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist); + mir_sntprintf(szTemp, TranslateT("%s: message session (%u users)"), szNick, si->nUsersInNicklist); break; case GCW_SERVER: - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s: Server"), szNick); + mir_sntprintf(szTemp, _T("%s: Server"), szNick); hIcon = LoadIconEx("window"); break; } diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index f7d9d81686..f9a9bdf5bb 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -468,13 +468,13 @@ static TCHAR* GetPreviewT(WORD eventType, DBEVENTINFO* dbe) if (szDescr && Utils::safe_strlen(szDescr, dbe->cbBlob - sizeof(DWORD) - namelength - 1) > 0) {
ptrT tszDescr(DbGetEventStringT(dbe, szDescr));
if (tszFileName && tszDescr) {
- mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s (%s)"), TranslateT("Incoming file"), tszFileName, tszDescr);
+ mir_sntprintf(buf, _T("%s: %s (%s)"), TranslateT("Incoming file"), tszFileName, tszDescr);
return mir_tstrdup(buf);
}
}
if (tszFileName) {
- mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s (%s)"), TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
+ mir_sntprintf(buf, _T("%s: %s (%s)"), TranslateT("Incoming file"), tszFileName, TranslateT("No description given"));
return mir_tstrdup(buf);
}
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index 9bd323e24e..18c6d9607c 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -44,7 +44,7 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData *dat) } else if (dat) { TCHAR szFilter[MAX_PATH], szFilename[MAX_PATH]; - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0); + mir_sntprintf(szFilter, _T("%s%c*.rtf%c%c"), TranslateT("Rich Edit file"), 0, 0, 0); mir_sntprintf(szFilename, SIZEOF(szFilename), _T("%s.rtf"), dat->cache->getNick()); Utils::sanitizeFilename(szFilename); @@ -1094,10 +1094,10 @@ LRESULT TSAPI DM_WMCopyHandler(HWND hwnd, WNDPROC oldWndProc, UINT msg, WPARAM w { LRESULT result = mir_callNextSubclass(hwnd, oldWndProc, msg, wParam, lParam); - ptrA szFromStream(Message_GetFromStream(hwnd, SF_TEXT | SFF_SELECTION));
- if (szFromStream != NULL) {
- ptrW converted(mir_utf8decodeW(szFromStream));
- if (converted != NULL) {
+ ptrA szFromStream(Message_GetFromStream(hwnd, SF_TEXT | SFF_SELECTION)); + if (szFromStream != NULL) { + ptrW converted(mir_utf8decodeW(szFromStream)); + if (converted != NULL) { Utils::FilterEventMarkers(converted); Utils::CopyToClipBoard(converted, hwnd); } diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp index caa644f02b..0ed4a9ff53 100644 --- a/plugins/TabSRMM/src/infopanel.cpp +++ b/plugins/TabSRMM/src/infopanel.cpp @@ -504,9 +504,9 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem) TCHAR temp[256];
ptrT szVersion(db_get_tsa(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer"));
if (szVersion)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client: %s"), szVersion);
+ mir_sntprintf(temp, TranslateT(" Client: %s"), szVersion);
else
- mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client not cached yet"));
+ mir_sntprintf(temp, TranslateT(" Client not cached yet"));
_tcscat_s(szBuf, 256, temp);
}
@@ -1507,7 +1507,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam LONG cy = rc.bottom;
HANDLE hTheme = 0;
- mir_sntprintf(szTitle, SIZEOF(szTitle), m_szTitle ? _T("%s (%s)") : _T("%s%s"), c->getNick(), m_szTitle ? m_szTitle : _T(""));
+ mir_sntprintf(szTitle, m_szTitle ? _T("%s (%s)") : _T("%s%s"), c->getNick(), m_szTitle ? m_szTitle : _T(""));
if (m_panel) {
HDC hdcMem = ::CreateCompatibleDC(hdc);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp index a91e8b592d..bdfd094f3d 100644 --- a/plugins/TabSRMM/src/msgdialog.cpp +++ b/plugins/TabSRMM/src/msgdialog.cpp @@ -589,9 +589,9 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar if ((int)mir_strlen((char*)hClip) > mwdat->nMax) {
TCHAR szBuffer[512];
if (M.GetByte("autosplit", 0))
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
+ mir_sntprintf(szBuffer, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
+ mir_sntprintf(szBuffer, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
SendMessage(hwndParent, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)szBuffer);
}
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 96159f7743..739af6ae0b 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -450,7 +450,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat) if (dat->fInsertMode || fCaps || fNum)
mir_tstrcat(szBuf, _T(" | "));
- mir_sntprintf(buf, SIZEOF(buf), _T("%s%s %d/%d"), szBuf, dat->lcID, dat->iOpenJobs, len);
+ mir_sntprintf(buf, _T("%s%s %d/%d"), szBuf, dat->lcID, dat->iOpenJobs, len);
SendMessage(dat->pContainer->hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
if (PluginConfig.m_visualMessageSizeIndicator)
InvalidateRect(dat->pContainer->hwndStatus, NULL, FALSE);
@@ -930,7 +930,7 @@ BOOL TSAPI DoRtfToTags(const TWindowData *dat, CMString &pszText, int iNumColors 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');
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp index cf6d077f18..620feae359 100644 --- a/plugins/TabSRMM/src/msglog.cpp +++ b/plugins/TabSRMM/src/msglog.cpp @@ -832,7 +832,7 @@ static char* Template_CreateRTFFromDbEvent(TWindowData *dat, MCONTACT hContact, ptrT tszDescr(DbGetEventStringT(&dbei, szDescr));
TCHAR buf[1000];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s (%s)"), tszFileName, tszDescr);
+ mir_sntprintf(buf, _T("%s (%s)"), tszFileName, tszDescr);
AppendUnicodeToBuffer(str, buf, 0);
}
else AppendUnicodeToBuffer(str, tszFileName, 0);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index bc36b138cb..948e471350 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -453,14 +453,10 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, }
// if we have a max # of tabs/container set and want to open something in the default container...
- if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
- if ((pContainer = FindMatchingContainer(_T("default"))) == NULL) {
- TCHAR szName[CONTAINER_NAMELEN + 1];
- mir_sntprintf(szName, SIZEOF(szName), _T("default"));
- if ((pContainer = CreateContainer(szName, CNT_CREATEFLAG_CLONED, hContact)) == NULL)
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6))
+ if ((pContainer = FindMatchingContainer(_T("default"))) == NULL)
+ if ((pContainer = CreateContainer(_T("default"), CNT_CREATEFLAG_CLONED, hContact)) == NULL)
return 0;
- }
- }
TNewWindowData newData = { 0 };
newData.hContact = hContact;
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp index c98b28c076..dc4c16ab31 100644 --- a/plugins/TabSRMM/src/srmm.cpp +++ b/plugins/TabSRMM/src/srmm.cpp @@ -156,7 +156,7 @@ int _DebugPopup(MCONTACT hContact, const TCHAR *fmt, ...) if (ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) { MIRANDASYSTRAYNOTIFY tn; TCHAR szTitle[128]; - mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("TabSRMM message (%s)"), + mir_sntprintf(szTitle, TranslateT("TabSRMM message (%s)"), (hContact != 0) ? pcli->pfnGetContactDisplayName(hContact, 0) : TranslateT("Global")); tn.szProto = NULL; diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp index 1342aff813..fb63069d01 100644 --- a/plugins/TabSRMM/src/taskbar.cpp +++ b/plugins/TabSRMM/src/taskbar.cpp @@ -875,7 +875,7 @@ void CThumbMUC::renderContent() if (mi) {
if (m_dat->dwUnread) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%d unread"), m_dat->dwUnread);
+ mir_sntprintf(szTemp, TranslateT("%d unread"), m_dat->dwUnread);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
}
@@ -887,18 +887,18 @@ void CThumbMUC::renderContent() _p++;
wchar_t _t = *_p;
*_p = 0;
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
+ mir_sntprintf(szTemp, TranslateT("Chat room %s"), m_dat->si->ptszStatusbarText);
*_p = _t;
}
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Chat room %s"), L"");
+ mir_sntprintf(szTemp, TranslateT("Chat room %s"), L"");
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
m_rcIcon.top += m_sz.cy;
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
+ mir_sntprintf(szTemp, TranslateT("%d user(s)"), m_dat->si->nUsersInNicklist);
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("Server window"));
+ mir_sntprintf(szTemp, TranslateT("Server window"));
CSkin::RenderText(m_hdc, m_dat->hTheme, szTemp, &m_rcIcon, m_dtFlags | DT_SINGLELINE | DT_RIGHT, 10, 0, true);
if (mi->tszIdleMsg[0] && mir_tstrlen(mi->tszIdleMsg) > 2) {
m_rcIcon.top += m_sz.cy;
@@ -917,7 +917,7 @@ void CThumbMUC::renderContent() szStatusMsg = TranslateT("no topic set.");
}
else if (mi) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
+ mir_sntprintf(szTemp, TranslateT("%s on %s%s"), m_dat->szMyNickname, mi->ptszModDispName, L"");
szStatusMsg = szTemp;
}
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index a0825801b6..e69da7e766 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1677,9 +1677,9 @@ void CSkin::setupAeroSkins() // load unknown avatar..
if (0 == PluginConfig.g_hbmUnknown) {
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%scustom_unknown.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%scustom_unknown.png"), tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%sunknown.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%sunknown.png"), tszBasePath);
PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
if (PluginConfig.g_hbmUnknown == 0) {
HDC dc = GetDC(0);
@@ -1688,9 +1688,9 @@ void CSkin::setupAeroSkins() }
}
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%scustom_tabskin_aero.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%scustom_tabskin_aero.png"), tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%stabskin_aero.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%stabskin_aero.png"), tszBasePath);
BOOL isOpaque = false;
if (CMimAPI::m_pfnDwmGetColorizationColor && M.isAero())
@@ -1775,9 +1775,9 @@ void CSkin::setupAeroSkins() m_tabBottom->setMetrics(bm.bmWidth, bm.bmHeight);
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%scustom_tabskin_aero_glow.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%scustom_tabskin_aero_glow.png"), tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%stabskin_aero_glow.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%stabskin_aero_glow.png"), tszBasePath);
fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
@@ -1808,9 +1808,9 @@ void CSkin::setupAeroSkins() m_tabGlowBottom->setMetrics(bm.bmWidth, bm.bmHeight);
// background item for the button switch bar
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%scustom_tabskin_aero_button.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%scustom_tabskin_aero_button.png"), tszBasePath);
if (!PathFileExists(tszFilename))
- mir_sntprintf(tszFilename, SIZEOF(tszFilename), _T("%stabskin_aero_button.png"), tszBasePath);
+ mir_sntprintf(tszFilename, _T("%stabskin_aero_button.png"), tszBasePath);
hbm = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR);
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp index efc5854703..ced9ac7c04 100644 --- a/plugins/TabSRMM/src/userprefs.cpp +++ b/plugins/TabSRMM/src/userprefs.cpp @@ -417,7 +417,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetClientRect(hwndDlg, &rcClient);
TCHAR szBuffer[180];
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
+ mir_sntprintf(szBuffer, TranslateT("Set messaging options for %s"), pcli->pfnGetContactDisplayName(hContact, 0));
SetWindowText(hwndDlg, szBuffer);
memset(&tci, 0, sizeof(tci));
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp index 54faf0ff79..f69a4c8c2b 100644 --- a/plugins/TabSRMM/src/utils.cpp +++ b/plugins/TabSRMM/src/utils.cpp @@ -146,7 +146,7 @@ const TCHAR* Utils::FormatRaw(TWindowData *dat, const TCHAR *msg, int flags, BOO TCHAR szTemp[5];
message.insert(beginmark, _T("cxxx "));
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%02d"), MSGDLGFONTCOUNT + 13 + ii);
+ mir_sntprintf(szTemp, _T("%02d"), MSGDLGFONTCOUNT + 13 + ii);
message[beginmark + 3] = szTemp[0];
message[beginmark + 4] = szTemp[1];
clr_found = true;
@@ -1277,7 +1277,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP ::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_AUTOURLDETECT, TRUE, 0);
::SendDlgItemMessage(hwnd, IDC_WARNTEXT, EM_SETEVENTMASK, 0, ENM_LINK);
- mir_sntprintf(temp, SIZEOF(temp), RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
+ mir_sntprintf(temp, RTF_DEFAULT_HEADER, 0, 0, 0, 30 * 15);
tstring *str = new tstring(temp);
str->append(m_szText);
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index a0755b2a2f..a40103b154 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -1494,7 +1494,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa iCountOnline++; iCount++; } - mir_sntprintf(buff, SIZEOF(buff), _T("(%d/%d)"), iCountOnline, iCount); + mir_sntprintf(buff, _T("(%d/%d)"), iCountOnline, iCount); } else buff[0] = 0; @@ -1648,7 +1648,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa index -= iCount; if (index >= 0 && (dwItems & TRAYTIP_NUMCONTACTS) && !((opt.iFavoriteContFlags & FAVCONT_HIDE_OFFLINE) && iCountOnline == 0)) { - mir_sntprintf(buff, SIZEOF(buff), _T("(%d/%d)"), iCountOnline, iCount); + mir_sntprintf(buff, _T("(%d/%d)"), iCountOnline, iCount); pwd->rows[index].swzValue = mir_tstrdup(buff); } } diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 44f4e81a40..32ffb499fd 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -408,13 +408,13 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) if (pPsh->_dwFlags & PSF_PROTOPAGESONLY) {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%s %d\\%s"), odp->ptszTitle, pPsh->_nSubContact+1, odp->ptszTab);
+ mir_sntprintf(szTitle, _T("%s %d\\%s"), odp->ptszTitle, pPsh->_nSubContact+1, odp->ptszTab);
else
- mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%s %d"), odp->ptszTitle, pPsh->_nSubContact+1);
+ mir_sntprintf(szTitle, _T("%s %d"), odp->ptszTitle, pPsh->_nSubContact+1);
}
else {
if (_dwFlags & ODPF_USERINFOTAB)
- mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%s\\%s"), odp->ptszTitle, odp->ptszTab);
+ mir_sntprintf(szTitle, _T("%s\\%s"), odp->ptszTitle, odp->ptszTab);
else
mir_tstrcpy(szTitle, odp->ptszTitle);
}
diff --git a/plugins/UserInfoEx/src/ctrl_annivedit.cpp b/plugins/UserInfoEx/src/ctrl_annivedit.cpp index 5bec3bdfea..162f8f83e9 100644 --- a/plugins/UserInfoEx/src/ctrl_annivedit.cpp +++ b/plugins/UserInfoEx/src/ctrl_annivedit.cpp @@ -404,7 +404,7 @@ INT_PTR CAnnivEditCtrl::SetCurSel(WORD wIndex) }
else {
TCHAR szText[MAX_DESC];
- mir_sntprintf(szText, SIZEOF(szText), _T("'%s'"), TranslateT("Unspecified"));
+ mir_sntprintf(szText, _T("'%s'"), TranslateT("Unspecified"));
DateTime_SetSystemtime(_hwndDate, GDT_NONE, NULL);
DateTime_SetFormat(_hwndDate, szText);
}
diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index ba2f7fd602..16174e982b 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -430,7 +430,7 @@ static int OnShutdown(WPARAM wParam, LPARAM lParam) static int AddProtocolPages(OPTIONSDIALOGPAGE& odp, WPARAM wParam, LPSTR pszProto = NULL)
{
TCHAR szTitle[MAX_PATH];
- const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%S\\"), pszProto) : 0;
+ const BYTE ofs = (pszProto) ? mir_sntprintf(szTitle, _T("%S\\"), pszProto) : 0;
odp.ptszTitle = szTitle;
diff --git a/plugins/Weather/src/weather_update.cpp b/plugins/Weather/src/weather_update.cpp index ed9275e2c4..afa00c84a2 100644 --- a/plugins/Weather/src/weather_update.cpp +++ b/plugins/Weather/src/weather_update.cpp @@ -554,7 +554,7 @@ int GetWeatherData(MCONTACT hContact) db_set_ts(NULL, DEFCURRENTWEATHER, _T2A(Item->Item.Name), DataValue);
if ( !mir_tstrcmp(Item->Item.Name, _T("Condition"))) {
TCHAR buf[128], *cbuf;
- mir_sntprintf(buf, SIZEOF(buf), _T("#%s Weather"), DataValue);
+ mir_sntprintf(buf, _T("#%s Weather"), DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
cbuf = TranslateTS(DataValue);
@@ -564,7 +564,7 @@ int GetWeatherData(MCONTACT hContact) }
else if ( mir_tstrcmpi(Item->Item.Unit, _T("Cond")) == 0) {
TCHAR buf[128], *cbuf;
- mir_sntprintf(buf, SIZEOF(buf), _T("#%s Weather"), DataValue);
+ mir_sntprintf(buf, _T("#%s Weather"), DataValue);
cbuf = TranslateTS(buf);
if (cbuf[0] == '#')
cbuf = TranslateTS(DataValue);
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 294372504a..839d7b5752 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -120,7 +120,7 @@ void ShowWumfPopup(PWumf w) if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
mir_sntprintf(title, SIZEOF(title), _T("%s (%s)"), w->szComp, w->szUser);
- mir_sntprintf(text, SIZEOF(text), _T("%s (%s)"), w->szPath, w->szPerm);
+ mir_sntprintf(text, _T("%s (%s)"), w->szPath, w->szPerm);
ShowThePopup(w, title, text);
}
diff --git a/plugins/YAMN/src/proto/pop3/pop3comm.cpp b/plugins/YAMN/src/proto/pop3/pop3comm.cpp index d67712eb0a..a8f458ebd7 100644 --- a/plugins/YAMN/src/proto/pop3/pop3comm.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3comm.cpp @@ -269,7 +269,7 @@ int RegisterPOP3Plugin(WPARAM, LPARAM) if (ERROR_FILE_NOT_FOUND != GetLastError())
{
TCHAR temp[1024] = { 0 };
- mir_sntprintf(temp, SIZEOF(temp), _T("%s\n%s"), TranslateT("Reading file error. File already in use?"), FileName);
+ mir_sntprintf(temp, _T("%s\n%s"), TranslateT("Reading file error. File already in use?"), FileName);
MessageBox(NULL, temp, TranslateT("YAMN (internal POP3) read error"), MB_OK);
CallService(MS_YAMN_DELETEFILENAME, (WPARAM)FileName, 0);
FileName = NULL;
@@ -344,7 +344,7 @@ DWORD WINAPI WritePOP3Accounts() DWORD ReturnValue = CallService(MS_YAMN_WRITEACCOUNTS, (WPARAM)POP3Plugin, (LPARAM)FileName);
if (ReturnValue == EACC_SYSTEM) {
TCHAR temp[1024] = { 0 };
- mir_sntprintf(temp, SIZEOF(temp), _T("%s\n%s"), TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
+ mir_sntprintf(temp, _T("%s\n%s"), TranslateT("Error while copying data to disk occurred. Is file in use?"), FileName);
MessageBox(NULL, temp, TranslateT("POP3 plugin - write file error"), MB_OK);
}
diff --git a/plugins/YARelay/src/main.cpp b/plugins/YARelay/src/main.cpp index a87eafb9a6..9539f80349 100644 --- a/plugins/YARelay/src/main.cpp +++ b/plugins/YARelay/src/main.cpp @@ -158,13 +158,13 @@ static int MessageEventAdded(WPARAM hContact, LPARAM hDBEvent) if (ci.type == CNFT_ASCIIZ)
_tcsncpy_s(buf, ci.pszVal, _TRUNCATE);
else if (ci.type == CNFT_BYTE)
- mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.bVal);
+ mir_sntprintf(buf, _T("%u"), ci.bVal);
else if (ci.type == CNFT_WORD)
- mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.wVal);
+ mir_sntprintf(buf, _T("%u"), ci.wVal);
else if (ci.type == CNFT_DWORD)
- mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.dVal);
+ mir_sntprintf(buf, _T("%u"), ci.dVal);
}
- else mir_sntprintf(buf, SIZEOF(buf), _T("%p"), hContact);
+ else mir_sntprintf(buf, _T("%p"), hContact);
}
szUtfMsg.append(T2Utf(buf));
break;
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index 661a5a41a8..56a7791b45 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -250,7 +250,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) {
TCHAR buf[20];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255);
+ mir_sntprintf(buf, _T("%d %%"), ps->alpha*100/255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
@@ -266,7 +266,7 @@ INT_PTR CALLBACK OptDlgProc(HWND hDlg,UINT msg,WPARAM wparam,LPARAM lparam) ps->alpha=SendDlgItemMessage(hDlg, IDC_SLIDER1, TBM_GETPOS, 0, 0);
{
TCHAR buf[20];
- mir_sntprintf(buf, SIZEOF(buf), _T("%d %%"), ps->alpha*100/255);
+ mir_sntprintf(buf, _T("%d %%"), ps->alpha*100/255);
SetDlgItemText(hDlg, IDC_ALPHATXT, buf);
}
goto xxx;
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp index 5a8ac4f8e8..91618cf53e 100644 --- a/protocols/AimOscar/src/proto.cpp +++ b/protocols/AimOscar/src/proto.cpp @@ -52,14 +52,14 @@ CAimProto::CAimProto(const char* aProtoName, const TCHAR* aUserName) : nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.szSettingsModule = m_szModuleName;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
char szP2P[128];
mir_snprintf(szP2P, SIZEOF(szP2P), "%sP2P", m_szModuleName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s Client-to-client connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s Client-to-client connection"), m_tszUserName);
nlu.szSettingsModule = szP2P;
nlu.minIncomingPorts = 1;
hNetlibPeer = (HANDLE) CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
diff --git a/protocols/FacebookRM/src/communication.cpp b/protocols/FacebookRM/src/communication.cpp index e9e3de967f..1bc95ff696 100644 --- a/protocols/FacebookRM/src/communication.cpp +++ b/protocols/FacebookRM/src/communication.cpp @@ -696,7 +696,7 @@ void loginError(FacebookProto *proto, std::string error_str) { proto->debugLogA("!!! Login error: %s", !error_str.empty() ? error_str.c_str() : "Unknown error"); TCHAR buf[200]; - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Login error: %s"), + mir_sntprintf(buf, TranslateT("Login error: %s"), (error_str.empty()) ? TranslateT("Unknown error") : ptrT(mir_utf8decodeT(error_str.c_str()))); proto->facy.client_notify(buf); } diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp index 968a0c5c99..4910eba167 100644 --- a/protocols/FacebookRM/src/proto.cpp +++ b/protocols/FacebookRM/src/proto.cpp @@ -93,12 +93,12 @@ FacebookProto::FacebookProto(const char* proto_name, const TCHAR* username) : NETLIBUSER nlu = { sizeof(nlu) }; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; nlu.szSettingsModule = m_szModuleName; - mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName); + mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); if (m_hNetlibUser == NULL) { TCHAR error[200]; - mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); + mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR); } diff --git a/protocols/Gadu-Gadu/src/avatar.cpp b/protocols/Gadu-Gadu/src/avatar.cpp index 1d27e336ed..c1d4936588 100644 --- a/protocols/Gadu-Gadu/src/avatar.cpp +++ b/protocols/Gadu-Gadu/src/avatar.cpp @@ -37,7 +37,7 @@ void GGPROTO::getAvatarFilename(MCONTACT hContact, TCHAR *pszDest, int cbLen) else {
debugLog(_T("getAvatarFilename(): Can not create directory for avatar cache: %s. errno=%d: %s"), pszDest, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pszDest);
+ mir_sntprintf(error, TranslateT("Cannot create avatars cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pszDest);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
@@ -271,7 +271,7 @@ void __cdecl GGPROTO::avatarrequestthread(void*) } else {
debugLog(_T("avatarrequestthread(): _topen file %s error. errno=%d: %s"), ai.filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ai.filename);
+ mir_sntprintf(error, TranslateT("Cannot create avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), ai.filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
}
@@ -363,7 +363,7 @@ void __cdecl GGPROTO::setavatarthread(void *param) if (file_fd == -1) {
debugLogA("setavatarthread(): Failed to open avatar file errno=%d: %s.", errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFilename);
+ mir_sntprintf(error, TranslateT("Cannot open avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFilename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
mir_free(szFilename);
int prevType = getByte(GG_KEY_AVATARTYPEPREV, -1);
diff --git a/protocols/Gadu-Gadu/src/core.cpp b/protocols/Gadu-Gadu/src/core.cpp index 70f393d3e9..f37120f268 100644 --- a/protocols/Gadu-Gadu/src/core.cpp +++ b/protocols/Gadu-Gadu/src/core.cpp @@ -361,7 +361,7 @@ void __cdecl GGPROTO::mainthread(void *) if (!(p.external_addr = gg_dnslookup(this, dbv.pszVal))) {
TCHAR error[128];
TCHAR* forwardHostT = mir_a2t(dbv.pszVal);
- mir_sntprintf(error, SIZEOF(error), TranslateT("External direct connections hostname %s is invalid. Disabling external host forwarding."), forwardHostT);
+ mir_sntprintf(error, TranslateT("External direct connections hostname %s is invalid. Disabling external host forwarding."), forwardHostT);
mir_free(forwardHostT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
}
@@ -392,7 +392,7 @@ retry: {
TCHAR error[128];
TCHAR* hostnameT = mir_a2t(hosts[hostnum].hostname);
- mir_sntprintf(error, SIZEOF(error), TranslateT("Server hostname %s is invalid. Using default hostname provided by the network."), hostnameT);
+ mir_sntprintf(error, TranslateT("Server hostname %s is invalid. Using default hostname provided by the network."), hostnameT);
mir_free(hostnameT);
showpopup(m_tszUserName, error, GG_POPUP_WARNING | GG_POPUP_ALLOW_MSGBOX);
}
@@ -423,7 +423,7 @@ retry: }
}
if (!perror) {
- mir_sntprintf(error, SIZEOF(error), TranslateT("Connection cannot be established. errno=%d: %s"),errno, strerror(errno));
+ mir_sntprintf(error, TranslateT("Connection cannot be established. errno=%d: %s"),errno, strerror(errno));
perror = error;
}
debugLogA("mainthread() (%x): %s", this, perror);
diff --git a/protocols/Gadu-Gadu/src/filetransfer.cpp b/protocols/Gadu-Gadu/src/filetransfer.cpp index 23f56f4a5b..61d8ab6014 100644 --- a/protocols/Gadu-Gadu/src/filetransfer.cpp +++ b/protocols/Gadu-Gadu/src/filetransfer.cpp @@ -677,7 +677,7 @@ HANDLE GGPROTO::dccfileallow(HANDLE hTransfer, const TCHAR* szPath) {
debugLogA("dccfileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
ProtoBroadcastAck((MCONTACT)dcc->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc, 0);
// Free transfer
@@ -726,7 +726,7 @@ HANDLE GGPROTO::dcc7fileallow(HANDLE hTransfer, const TCHAR* szPath) {
debugLogA("dcc7fileallow(): Failed to create file \"%s\". errno=%d: %s", fileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create transfer file. ERROR: %d: %s (dcc7)\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
gg_dcc7_reject(dcc7, GG_DCC7_REJECT_USER);
ProtoBroadcastAck((MCONTACT)dcc7->contact, ACKTYPE_FILE, ACKRESULT_FAILED, dcc7, 0);
diff --git a/protocols/Gadu-Gadu/src/gg_proto.cpp b/protocols/Gadu-Gadu/src/gg_proto.cpp index 9d0c8d4a2c..7c98ed6bc9 100644 --- a/protocols/Gadu-Gadu/src/gg_proto.cpp +++ b/protocols/Gadu-Gadu/src/gg_proto.cpp @@ -68,7 +68,7 @@ GGPROTO::GGPROTO(const char* pszProtoName, const TCHAR* tszUserName) : db_set_resident(m_szModuleName, GG_KEY_AVATARREQUESTED);
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
+ mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), (TCHAR*)VARST( _T("%miranda_userdata%")), m_tszUserName);
hImagesFolder = FoldersRegisterCustomPathT(LPGEN("Images"), m_szModuleName, szPath, m_tszUserName);
DWORD dwVersion;
@@ -452,7 +452,7 @@ HWND GGPROTO::SearchAdvanced(HWND hwndDlg) yearFrom = 0;
else
yearFrom = ay - yearFrom;
- mir_sntprintf(text, SIZEOF(text), _T("%d %d"), yearFrom, yearTo);
+ mir_sntprintf(text, _T("%d %d"), yearFrom, yearTo);
T2Utf age_utf8(text);
gg_pubdir50_add(req, GG_PUBDIR50_BIRTHYEAR, age_utf8);
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp index 0b9b9e21e0..1a1983e4e5 100644 --- a/protocols/Gadu-Gadu/src/groupchat.cpp +++ b/protocols/Gadu-Gadu/src/groupchat.cpp @@ -282,7 +282,7 @@ TCHAR* GGPROTO::gc_getchat(uin_t sender, uin_t *recipients, int recipients_count TCHAR *senderName = unknownSender ?
TranslateT("Unknown") : pcli->pfnGetContactDisplayName(getcontact(sender, 0, 0, NULL), 0);
TCHAR error[256];
- mir_sntprintf(error, SIZEOF(error), TranslateT("%s has initiated conference with %d participants (%d unknowns).\nDo you want to participate?"),
+ mir_sntprintf(error, TranslateT("%s has initiated conference with %d participants (%d unknowns).\nDo you want to participate?"),
senderName, recipients_count + 1, unknown);
chat->ignore = MessageBox(NULL, error, m_tszUserName, MB_OKCANCEL | MB_ICONEXCLAMATION) != IDOK;
}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp index 7fccf30251..f92c77fac1 100644 --- a/protocols/Gadu-Gadu/src/image.cpp +++ b/protocols/Gadu-Gadu/src/image.cpp @@ -422,9 +422,9 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP TCHAR *szName = pcli->pfnGetContactDisplayName(dat->hContact, 0), szTitle[128];
if (dat->bReceiving)
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Image from %s"), szName);
+ mir_sntprintf(szTitle, TranslateT("Image from %s"), szName);
else
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Image for %s"), szName);
+ mir_sntprintf(szTitle, TranslateT("Image for %s"), szName);
SetWindowText(hwndDlg, szTitle);
// Store client extents
@@ -505,7 +505,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (dat->bReceiving)
{
TCHAR szTitle[128];
- mir_sntprintf(szTitle, SIZEOF(szTitle), _T("%s (%d / %d)"), img->lpszFileName, dat->nImg, dat->nImgTotal);
+ mir_sntprintf(szTitle, _T("%s (%d / %d)"), img->lpszFileName, dat->nImg, dat->nImgTotal);
SetDlgItemText(hwndDlg, IDC_IMG_NAME, szTitle);
}
else
@@ -813,7 +813,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) if (hImagesFolder == NULL || FoldersGetCustomPathT(hImagesFolder, path, MAX_PATH, _T(""))) {
TCHAR *tmpPath = Utils_ReplaceVarsT( _T("%miranda_userdata%"));
- tPathLen = mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
+ tPathLen = mir_sntprintf(szPath, _T("%s\\%s\\ImageCache"), tmpPath, m_tszUserName);
mir_free(tmpPath);
}
else {
@@ -828,7 +828,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) } else {
debugLog(_T("img_displayasmsg(): Can not create directory for image cache: %s. errno=%d: %s"), szPath, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot create image cache directory. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR | GG_POPUP_ALLOW_MSGBOX | GG_POPUP_ONCE);
}
}
@@ -840,7 +840,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) for (i = 1; ; ++i)
{
if ((res = gg_img_isexists(szPath, dat)) != -1) break;
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
+ mir_sntprintf(szPath, _T("%.*s (%u)%s"), pImgext - szPath, szPath, i, imgext);
}
if (res == 0) {
@@ -852,7 +852,7 @@ int GGPROTO::img_displayasmsg(MCONTACT hContact, void *img) } else {
debugLog(_T("img_displayasmsg(): Cannot open file %s for write image. errno=%d: %s"), szPath, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
+ mir_sntprintf(error, TranslateT("Cannot save received image to file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szPath);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return 0;
}
@@ -975,7 +975,7 @@ void* GGPROTO::img_loadpicture(gg_event* e, TCHAR *szFileName) free(dat);
debugLog(_T("img_loadpicture(): fopen(\"%s\", \"rb\") failed. errno=%d: %s"), szFileName, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
+ mir_sntprintf(error, TranslateT("Cannot open image file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), szFileName);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
return NULL;
}
diff --git a/protocols/Gadu-Gadu/src/import.cpp b/protocols/Gadu-Gadu/src/import.cpp index 2ca709ae01..b82a30418f 100644 --- a/protocols/Gadu-Gadu/src/import.cpp +++ b/protocols/Gadu-Gadu/src/import.cpp @@ -278,7 +278,7 @@ INT_PTR GGPROTO::import_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "import_server", 65, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be imported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("import_server(): Cannot import list. errno:%d: %s", errno, strerror(errno));
}
@@ -316,7 +316,7 @@ INT_PTR GGPROTO::remove_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "remove_server", 66, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be removed because of error: %s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be removed because of error: %s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("remove_server(): Cannot remove list. errno=%d: %s", errno, strerror(errno));
}
@@ -389,7 +389,7 @@ INT_PTR GGPROTO::import_text(WPARAM wParam, LPARAM lParam) else
{
TCHAR error[256];
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be imported from file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLog(_T("import_text(): Cannot import list from file \"%s\". errno=%d: %s"), str, errno, strerror(errno));
}
@@ -450,7 +450,7 @@ INT_PTR GGPROTO::export_text(WPARAM wParam, LPARAM lParam) else
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be exported to file \"%s\" because of error:\n\t%s (Error: %d)"), str, _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("export_text(): Cannot export list to file \"%s\". errno=%d: %s", str, errno, strerror(errno));
}
@@ -494,7 +494,7 @@ INT_PTR GGPROTO::export_server(WPARAM wParam, LPARAM lParam) {
TCHAR error[128];
gg_LeaveCriticalSection(&sess_mutex, "export_server", 67, 1, "sess_mutex", 1);
- mir_sntprintf(error, SIZEOF(error), TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("List cannot be exported because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("export_server(): Cannot export list. errno=%d: %s", errno, strerror(errno));
}
diff --git a/protocols/Gadu-Gadu/src/ownerinfo.cpp b/protocols/Gadu-Gadu/src/ownerinfo.cpp index 7c8da3e1a4..96707513f2 100644 --- a/protocols/Gadu-Gadu/src/ownerinfo.cpp +++ b/protocols/Gadu-Gadu/src/ownerinfo.cpp @@ -57,7 +57,7 @@ void __cdecl GGPROTO::remindpasswordthread(void *param) if (!(h = gg_remind_passwd3(rp->uin, rp->email, token.id, token.val, 0)))
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
+ mir_sntprintf(error, TranslateT("Password could not be reminded because of error:\n\t%s (Error: %d)"), _tcserror(errno), errno);
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
debugLogA("remindpasswordthread(): Password could not be reminded. errno=%d: %s", errno, strerror(errno));
}
diff --git a/protocols/Gadu-Gadu/src/services.cpp b/protocols/Gadu-Gadu/src/services.cpp index e9c5b1adc6..834ccc8876 100644 --- a/protocols/Gadu-Gadu/src/services.cpp +++ b/protocols/Gadu-Gadu/src/services.cpp @@ -240,7 +240,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (_tremove(pai->filename) != 0){
debugLog(_T("getavatarinfo(): refresh. _tremove 1 file %s error. errno=%d: %s"), pai->filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
+ mir_sntprintf(error, TranslateT("Cannot remove old avatar file before refresh. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
setString(pai->hContact, GG_KEY_AVATARHASH, AvatarHash);
@@ -255,7 +255,7 @@ INT_PTR GGPROTO::getavatarinfo(WPARAM wParam, LPARAM lParam) if (_tremove(pai->filename) != 0){
debugLog(_T("getavatarinfo(): delete. _tremove file %s error. errno=%d: %s"), pai->filename, errno, strerror(errno));
TCHAR error[512];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
+ mir_sntprintf(error, TranslateT("Cannot remove old avatar file. ERROR: %d: %s\n%s"), errno, _tcserror(errno), pai->filename);
showpopup(m_tszUserName, error, GG_POPUP_ERROR);
}
delSetting(pai->hContact, GG_KEY_AVATARHASH);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp index b1625f4471..07ee15a443 100644 --- a/protocols/Gadu-Gadu/src/sessions.cpp +++ b/protocols/Gadu-Gadu/src/sessions.cpp @@ -330,7 +330,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w ListView_GetItemText(hList, lvhti.iItem, 0, szClientName, SIZEOF(szClientName));
ListView_GetItemText(hList, lvhti.iItem, 1, szIP, SIZEOF(szIP));
ListView_GetItemText(hList, lvhti.iItem, 2, szLoginTime, SIZEOF(szLoginTime));
- mir_sntprintf(szText, SIZEOF(szText), _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
+ mir_sntprintf(szText, _T("%s\t%s\t%s"), szClientName, szIP, szLoginTime);
if ((hData = GlobalAlloc(GMEM_MOVEABLE, mir_tstrlen(szText) + 1)) != NULL)
{
mir_tstrcpy((TCHAR*)GlobalLock(hData), szText);
diff --git a/protocols/Gadu-Gadu/src/token.cpp b/protocols/Gadu-Gadu/src/token.cpp index 2fcf36d31d..11f72ef8ce 100644 --- a/protocols/Gadu-Gadu/src/token.cpp +++ b/protocols/Gadu-Gadu/src/token.cpp @@ -117,7 +117,7 @@ int GGPROTO::gettoken(GGTOKEN *token) if (!(h = gg_token(0)) || gg_token_watch_fd(h) || h->state == GG_STATE_ERROR || h->state != GG_STATE_DONE) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
+ mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
return FALSE;
@@ -125,7 +125,7 @@ int GGPROTO::gettoken(GGTOKEN *token) if (!(t = (struct gg_token *)h->data) || (!h->body)) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
+ mir_sntprintf(error, TranslateT("Token retrieval failed because of error:\n\t%s"), http_error_string(h ? h->error : 0));
MessageBox(NULL, error, m_tszUserName, MB_OK | MB_ICONSTOP);
gg_free_pubdir(h);
return FALSE;
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp index a5fcae5ee3..ec4441b2a3 100644 --- a/protocols/Gadu-Gadu/src/userutils.cpp +++ b/protocols/Gadu-Gadu/src/userutils.cpp @@ -40,7 +40,7 @@ void *gg_doregister(GGPROTO *gg, char *newPass, char *newEmail) if (!(h = gg_register3(newEmail, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || !s->uin) {
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Cannot register new account because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Cannot register new account because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Registration rejected") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -85,7 +85,7 @@ void *gg_dounregister(GGPROTO *gg, uin_t uin, char *password) if (!(h = gg_unregister3(uin, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success || s->uin != uin)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your account cannot be removed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your account cannot be removed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Bad number or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -137,7 +137,7 @@ void *gg_dochpass(GGPROTO *gg, uin_t uin, char *password, char *newPass) if (!(h = gg_change_passwd4(uin, email, password, newPass, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your password cannot be changed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your password cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) :
(s ? TranslateT("Invalid data entered") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
@@ -179,7 +179,7 @@ void *gg_dochemail(GGPROTO *gg, uin_t uin, char *password, char *email, char *ne if (!(h = gg_change_passwd4(uin, newEmail, password, password, token.id, token.val, 0)) || !(s = (gg_pubdir*)h->data) || !s->success)
{
TCHAR error[128];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
+ mir_sntprintf(error, TranslateT("Your e-mail cannot be changed because of error:\n\t%s"),
(h && !s) ? http_error_string(h ? h->error : 0) : (s ? TranslateT("Bad old e-mail or password") : _tcserror(errno)));
MessageBox(NULL, error, gg->m_tszUserName, MB_OK | MB_ICONSTOP);
gg->debugLogA("gg_dochemail(): Cannot change e-mail. errno=%d: %s", errno, strerror(errno));
diff --git a/protocols/IRCG/src/commandmonitor.cpp b/protocols/IRCG/src/commandmonitor.cpp index e6cdea96ee..a5b3f359be 100644 --- a/protocols/IRCG/src/commandmonitor.cpp +++ b/protocols/IRCG/src/commandmonitor.cpp @@ -530,7 +530,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) if (m_oldStyleModes) {
TCHAR temp[256];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s"),
+ mir_sntprintf(temp, TranslateT("%s sets mode %s"),
pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
CMString sMessage = temp;
@@ -544,7 +544,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) sParams += _T(" ") + pmsg->parameters[i];
TCHAR temp[4000];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
+ mir_sntprintf(temp, TranslateT("%s sets mode %s%s"), pmsg->prefix.sNick.c_str(), sModes.c_str(), sParams.c_str());
DoEvent(GC_EVENT_INFORMATION, pmsg->parameters[0].c_str(), pmsg->prefix.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
@@ -553,7 +553,7 @@ bool CIrcProto::OnIrc_MODE(const CIrcMessage* pmsg) }
else {
TCHAR temp[256];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s sets mode %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
CMString sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++)
@@ -741,7 +741,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) // exploit???
if (mess.Find(1) != -1 || mess.Find(_T("%newl")) != -1) {
TCHAR temp[4096];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP ERROR: Malformed CTCP command received from %s!%s@%s. Possible attempt to take control of your IRC client registered"), pmsg->prefix.sNick.c_str(), pmsg->prefix.sUser.c_str(), pmsg->prefix.sHost.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
return true;
}
@@ -799,7 +799,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001FINGER %s (%s)\001"), pmsg->prefix.sNick.c_str(), m_name, m_userID);
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP FINGER requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -808,7 +808,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001VERSION Miranda NG %%mirver (IRC v.%%version), (c) 2003-2014 J.Persson, G.Hazan\001"), pmsg->prefix.sNick.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP VERSION requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -817,7 +817,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001SOURCE Get Miranda IRC here: http://miranda-ng.org/ \001"), pmsg->prefix.sNick.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP SOURCE requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -826,7 +826,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001USERINFO %s\001"), pmsg->prefix.sNick.c_str(), m_userInfo);
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP USERINFO requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -835,7 +835,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) PostIrcMessage(_T("/NOTICE %s \001%s\001"), pmsg->prefix.sNick.c_str(), mess.c_str());
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP PING requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -846,7 +846,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) mir_tstrncpy(temp, _tctime(&tim), 25);
PostIrcMessage(_T("/NOTICE %s \001TIME %s\001"), pmsg->prefix.sNick.c_str(), temp);
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP TIME requested by %s"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
@@ -1014,16 +1014,16 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) ulAdr = ConvertIPToInteger(m_IPFromServer ? m_myHost : m_myLocalHost);
if (bIsChat && !m_DCCChatEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
else if (type == _T("send") && !m_DCCFileEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: File transfer request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: File transfer request from %s denied"), pmsg->prefix.sNick.c_str());
else if (type == _T("send") && !iPort && ulAdr == 0)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Reverse file transfer request from %s denied [No local IP]"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Reverse file transfer request from %s denied [No local IP]"), pmsg->prefix.sNick.c_str());
if (sFile.IsEmpty() || dwAdr == 0 || dwSize == 0 || iPort == 0 && sToken.IsEmpty())
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
@@ -1042,10 +1042,10 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) szTemp[0] = '\0';
if (type == _T("resume") && !m_DCCFileEnabled)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: File transfer resume request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: File transfer resume request from %s denied"), pmsg->prefix.sNick.c_str());
if (sToken.IsEmpty() && iPort == 0 || sFile.IsEmpty())
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Malformed CTCP request from %s [%s]"), pmsg->prefix.sNick.c_str(), mess.c_str());
if (szTemp[0]) {
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
@@ -1077,7 +1077,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
else {
TCHAR szTemp[512];
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC: Chat request from %s denied"), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
@@ -1174,7 +1174,7 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) }
else if (pmsg->m_bIncoming) {
TCHAR temp[300];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("CTCP %s requested by %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, temp, NULL, NULL, NULL, true, false);
}
}
@@ -1206,9 +1206,9 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
TCHAR szTemp[30];
if (s == 1)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u second"), s);
+ mir_sntprintf(szTemp, _T("%u second"), s);
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u seconds"), s);
+ mir_sntprintf(szTemp, _T("%u seconds"), s);
m_whoisDlg->m_Reply.SetText(DoColorCodes(szTemp, TRUE, FALSE));
return true;
@@ -1219,11 +1219,11 @@ bool CIrcProto::IsCTCP(const CIrcMessage* pmsg) //... else show the reply in the current window
if (pmsg->m_bIncoming && command == _T("ping")) {
int s = (int)time(0) - (int)_ttol(GetWordAddress(mess.c_str(), 1));
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
+ mir_sntprintf(szTemp, TranslateT("CTCP PING reply from %s: %u sec(s)"), pmsg->prefix.sNick.c_str(), s);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP %s reply from %s: %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 1));
+ mir_sntprintf(szTemp, TranslateT("CTCP %s reply from %s: %s"), ocommand.c_str(), pmsg->prefix.sNick.c_str(), GetWordAddress(mess.c_str(), 1));
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
}
@@ -1542,9 +1542,9 @@ bool CIrcProto::OnIrc_LIST(const CIrcMessage* pmsg) TCHAR text[100];
if (percent < 100)
- mir_sntprintf(text, SIZEOF(text), TranslateT("Downloading list (%u%%) - %u channels"), percent, m_channelNumber);
+ mir_sntprintf(text, TranslateT("Downloading list (%u%%) - %u channels"), percent, m_channelNumber);
else
- mir_sntprintf(text, SIZEOF(text), TranslateT("Downloading list - %u channels"), m_channelNumber);
+ mir_sntprintf(text, TranslateT("Downloading list - %u channels"), m_channelNumber);
m_listDlg->m_status.SetText(text);
}
@@ -1562,7 +1562,7 @@ bool CIrcProto::OnIrc_LISTEND(const CIrcMessage* pmsg) m_listDlg->UpdateList();
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Done: %u channels"), m_channelNumber);
+ mir_sntprintf(text, TranslateT("Done: %u channels"), m_channelNumber);
int percent = 100;
if (m_noOfChannels > 0)
percent = (int)(m_channelNumber * 100) / m_noOfChannels;
@@ -1712,13 +1712,13 @@ bool CIrcProto::OnIrc_WHOIS_IDLE(const CIrcMessage* pmsg) TCHAR temp[100];
if (D)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
+ mir_sntprintf(temp, TranslateT("%ud, %uh, %um, %us"), D, H, M, S);
else if (H)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%uh, %um, %us"), H, M, S);
+ mir_sntprintf(temp, TranslateT("%uh, %um, %us"), H, M, S);
else if (M)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%um, %us"), M, S);
+ mir_sntprintf(temp, TranslateT("%um, %us"), M, S);
else if (S)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%us"), S);
+ mir_sntprintf(temp, TranslateT("%us"), S);
else
temp[0] = 0;
diff --git a/protocols/IRCG/src/input.cpp b/protocols/IRCG/src/input.cpp index 2d8a84dd97..098c8d1171 100644 --- a/protocols/IRCG/src/input.cpp +++ b/protocols/IRCG/src/input.cpp @@ -310,7 +310,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta AddIgnore(one.c_str(), IgnoreFlags.c_str(), m_network.c_str());
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), m_network.c_str(), IgnoreFlags.c_str());
+ mir_sntprintf(temp, TranslateT("%s on %s is now ignored (+%s)"), one.c_str(), m_network.c_str(), IgnoreFlags.c_str());
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
return true;
@@ -322,9 +322,9 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta TCHAR temp[500];
if (RemoveIgnore(one.c_str()))
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s is not ignored now"), one.c_str());
+ mir_sntprintf(temp, TranslateT("%s is not ignored now"), one.c_str());
else
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s was not ignored"), one.c_str());
+ mir_sntprintf(temp, TranslateT("%s was not ignored"), one.c_str());
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
return true;
}
@@ -375,7 +375,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta gci.pszModule = m_szModuleName;
gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci))
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("users: %u"), gci.iCount);
+ mir_sntprintf(szTemp, _T("users: %u"), gci.iCount);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
return true;
@@ -425,7 +425,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), TranslateT("The time interval for the buddy check function is now at default setting"), NULL, NULL, NULL, true, false);
else {
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
+ mir_sntprintf(temp, TranslateT("The time interval for the buddy check function is now %u seconds"), m_iTempCheckTime);
DoEvent(GC_EVENT_INFORMATION, NULL, m_info.sNick.c_str(), temp, NULL, NULL, NULL, true, false);
}
}
@@ -499,7 +499,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta int minutes2 = (int)m_noOfChannels / 9000;
TCHAR text[256];
- mir_sntprintf(text, SIZEOF(text), TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
+ mir_sntprintf(text, TranslateT("This command is not recommended on a network of this size!\r\nIt will probably cause high CPU usage and/or high bandwidth\r\nusage for around %u to %u minute(s).\r\n\r\nDo you want to continue?"), minutes2, minutes);
if (m_noOfChannels < 4000 || (m_noOfChannels >= 4000 && MessageBox(NULL, text, TranslateT("IRC warning"), MB_YESNO | MB_ICONWARNING | MB_DEFBUTTON2) == IDYES)) {
ListView_DeleteAllItems(GetDlgItem(m_listDlg->GetHwnd(), IDC_INFO_LISTVIEW));
PostIrcMessage(_T("/lusers"));
@@ -514,7 +514,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\001ACTION %s\001"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("\001ACTION %s\001"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
}
@@ -544,7 +544,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta return true;
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
return true;
@@ -579,7 +579,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (!two.IsEmpty()) {
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s"), GetWordAddress(text.c_str(), 1));
PostIrcMessageWnd(window, hContact, szTemp);
}
return true;
@@ -599,14 +599,14 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta // if it is not dcc or if it is dcc and a local ip exist
if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0 || ulAdr) {
if (mir_tstrcmpi(two.c_str(), _T("ping")) == 0)
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s \001%s %u\001"), one.c_str(), two.c_str(), time(0));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s %u\001"), one.c_str(), two.c_str(), time(0));
else
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/PRIVMSG %s \001%s\001"), one.c_str(), GetWordAddress(text.c_str(), 2));
+ mir_sntprintf(szTemp, _T("/PRIVMSG %s \001%s\001"), one.c_str(), GetWordAddress(text.c_str(), 2));
PostIrcMessageWnd(window, hContact, szTemp);
}
if (mir_tstrcmpi(two.c_str(), _T("dcc")) != 0) {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
+ mir_sntprintf(szTemp, TranslateT("CTCP %s request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
@@ -661,7 +661,7 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta }
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
return true;
@@ -700,16 +700,16 @@ BOOL CIrcProto::DoHardcodedCommand(CMString text, TCHAR* window, MCONTACT hConta if (iPort != 0) {
PostIrcMessage(_T("/CTCP %s DCC CHAT chat %u %u"), two.c_str(), ulAdr, iPort);
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
+ mir_sntprintf(szTemp, TranslateT("DCC CHAT request sent to %s"), two.c_str(), one.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to bind port"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to bind port"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
else {
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
+ mir_sntprintf(szTemp, TranslateT("DCC ERROR: Unable to automatically resolve external IP"));
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
}
}
diff --git a/protocols/IRCG/src/irclib.cpp b/protocols/IRCG/src/irclib.cpp index ca3f4aea60..4b2b74112d 100644 --- a/protocols/IRCG/src/irclib.cpp +++ b/protocols/IRCG/src/irclib.cpp @@ -201,7 +201,7 @@ bool CIrcProto::Connect(const CIrcSessionInfo& info) con = (HANDLE)CallService(MS_NETLIB_OPENCONNECTION, (WPARAM)m_hNetlibUser, (LPARAM)&ncon); if (con == NULL) { TCHAR szTemp[300]; - mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\0035%s \002%s\002 (%S: %u)."), + mir_sntprintf(szTemp, _T("\0035%s \002%s\002 (%S: %u)."), TranslateT("Failed to connect to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort); DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false); return false; diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp index aa744eb914..a29b5c9a6d 100644 --- a/protocols/IRCG/src/ircproto.cpp +++ b/protocols/IRCG/src/ircproto.cpp @@ -224,7 +224,7 @@ int CIrcProto::OnModulesLoaded(WPARAM, LPARAM) CallChatEvent(WINDOW_HIDDEN, (LPARAM)&gce);
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_perform.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszPerformData = IrcLoadFile(szLoadFileName);
if (pszPerformData != NULL) {
@@ -595,13 +595,13 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz PostIrcMessage(_T("/CTCP %s DCC SEND %s 200 0 %I64u %u"),
dci->sContactName.c_str(), sFileWithQuotes.c_str(), dci->dwSize, dcc->iToken);
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("DCC reversed file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
if (m_sendNotice) {
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
_T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [Reverse transfer]"),
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024);
PostIrcMessage(szTemp);
@@ -614,13 +614,13 @@ HANDLE __cdecl CIrcProto::SendFile(MCONTACT hContact, const TCHAR*, TCHAR** ppsz PostIrcMessage(_T("/CTCP %s DCC SEND %s %u %u %I64u"),
dci->sContactName.c_str(), sFileWithQuotes.c_str(), ulAdr, iPort, dci->dwSize);
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
TranslateT("DCC file transfer request sent to %s [%s]"),
dci->sContactName.c_str(), sFileCorrect.c_str());
DoEvent(GC_EVENT_INFORMATION, 0, m_info.sNick.c_str(), szTemp, NULL, NULL, NULL, true, false);
if (m_sendNotice) {
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
_T("/NOTICE %s I am sending the file '\002%s\002' (%I64u kB) to you, please accept it. [IP: %s]"),
dci->sContactName.c_str(), sFileCorrect.c_str(), dci->dwSize / 1024, (TCHAR*)_A2T(ConvertIntegerToIP(ulAdr)));
PostIrcMessage(szTemp);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 24f51da361..5bd7ac5427 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -620,7 +620,7 @@ void CConnectPrefsDlg::OnDeleteServer(CCtrlButton*) SERVER_INFO *pData = (SERVER_INFO*)m_serverCombo.GetItemData(i);
TCHAR temp[200];
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("Do you want to delete\r\n%s"), (TCHAR*)_A2T(pData->m_name));
+ mir_sntprintf(temp, TranslateT("Do you want to delete\r\n%s"), (TCHAR*)_A2T(pData->m_name));
if (MessageBox(m_hwnd, temp, TranslateT("Delete server"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
g_servers.remove(pData);
@@ -850,7 +850,7 @@ void CCtcpPrefsDlg::OnInitDialog() m_combo.AddStringA("8192");
TCHAR szTemp[10];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u"), m_proto->m_DCCPacketSize);
+ mir_sntprintf(szTemp, _T("%u"), m_proto->m_DCCPacketSize);
int i = m_combo.SelectString(szTemp);
if (i == CB_ERR)
m_combo.SelectString(_T("4096"));
@@ -1338,7 +1338,7 @@ static LRESULT CALLBACK ListviewSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, void CIrcProto::InitIgnore(void)
{
TCHAR szTemp[MAX_PATH];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
+ mir_sntprintf(szTemp, _T("%%miranda_path%%\\Plugins\\%S_ignore.ini"), m_szModuleName);
TCHAR *szLoadFileName = Utils_ReplaceVarsT(szTemp);
char* pszIgnoreData = IrcLoadFile(szLoadFileName);
if (pszIgnoreData != NULL) {
diff --git a/protocols/IRCG/src/output.cpp b/protocols/IRCG/src/output.cpp index 94eae7e12d..c86d78fb61 100644 --- a/protocols/IRCG/src/output.cpp +++ b/protocols/IRCG/src/output.cpp @@ -28,7 +28,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) if (pmsg->m_bIncoming) { // Is it an incoming message?
if (pmsg->sCommand == _T("WALLOPS") && pmsg->parameters.getCount() > 0) {
TCHAR temp[200]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
+ mir_sntprintf(temp, TranslateT("WallOps from %s: "), pmsg->prefix.sNick.c_str());
sMessage = temp;
for (int i = 0; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
@@ -40,7 +40,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) if (pmsg->sCommand == _T("INVITE") && pmsg->parameters.getCount() > 1) {
TCHAR temp[256]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s invites you to %s"), pmsg->prefix.sNick.c_str(), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += _T(": ") + pmsg->parameters[i];
@@ -53,7 +53,7 @@ static CMString FormatOutput(const CIrcMessage* pmsg) int index = _ttoi(pmsg->sCommand.c_str());
if (index == 301 && pmsg->parameters.getCount() > 0) {
TCHAR temp[500]; *temp = '\0';
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("%s is away"), pmsg->parameters[1].c_str());
+ mir_sntprintf(temp, TranslateT("%s is away"), pmsg->parameters[1].c_str());
sMessage = temp;
for (int i = 2; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += _T(": ") + pmsg->parameters[i];
@@ -90,13 +90,13 @@ static CMString FormatOutput(const CIrcMessage* pmsg) tempstr.Delete(tempstr.GetLength() - 1, 1);
CMString type = GetWord(tempstr.c_str(), 0);
if (mir_tstrcmpi(type.c_str(), _T("ping")) == 0)
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
+ mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s"), type.c_str(), pmsg->parameters[0].c_str());
else
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("CTCP %s reply sent to %s: %s"), type.c_str(), pmsg->parameters[0].c_str(), GetWordAddress(tempstr.c_str(), 1));
+ mir_sntprintf(temp, TranslateT("CTCP %s reply sent to %s: %s"), type.c_str(), pmsg->parameters[0].c_str(), GetWordAddress(tempstr.c_str(), 1));
sMessage = temp;
}
else {
- mir_sntprintf(temp, SIZEOF(temp), TranslateT("Notice to %s: "), pmsg->parameters[0].c_str());
+ mir_sntprintf(temp, TranslateT("Notice to %s: "), pmsg->parameters[0].c_str());
sMessage = temp;
for (int i = 1; i < (int)pmsg->parameters.getCount(); i++) {
sMessage += pmsg->parameters[i];
diff --git a/protocols/IRCG/src/scripting.cpp b/protocols/IRCG/src/scripting.cpp index a88dbdbf4d..2082bad904 100644 --- a/protocols/IRCG/src/scripting.cpp +++ b/protocols/IRCG/src/scripting.cpp @@ -148,7 +148,7 @@ INT_PTR __cdecl CIrcProto::Scripting_GetIrcData(WPARAM, LPARAM lparam) gci.pszID = S.c_str();
if (!CallServiceSync(MS_GC_GETINFO, 0, (LPARAM)&gci)) {
TCHAR szTemp[40];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%u"), gci.iCount);
+ mir_sntprintf(szTemp, _T("%u"), gci.iCount);
sOutput = szTemp;
}
}
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp index 2d77ee5f17..f90d18381f 100644 --- a/protocols/IRCG/src/services.cpp +++ b/protocols/IRCG/src/services.cpp @@ -199,7 +199,7 @@ INT_PTR __cdecl CIrcProto::OnDoubleclicked(WPARAM, LPARAM lParam) dlg->Show();
HWND hWnd = dlg->GetHwnd();
TCHAR szTemp[500];
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("%s (%s) is requesting a client-to-client chat connection."),
+ mir_sntprintf(szTemp, TranslateT("%s (%s) is requesting a client-to-client chat connection."),
pdci->sContactName.c_str(), pdci->sHostmask.c_str());
SetDlgItemText(hWnd, IDC_TEXT, szTemp);
ShowWindow(hWnd, SW_SHOW);
@@ -532,7 +532,7 @@ int __cdecl CIrcProto::GCEventHook(WPARAM, LPARAM lParam) case GC_USER_PRIVMESS:
{
TCHAR szTemp[4000];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("/QUERY %s"), gch->ptszUID);
+ mir_sntprintf(szTemp, _T("/QUERY %s"), gch->ptszUID);
PostIrcMessageWnd(p1, NULL, szTemp);
}
break;
@@ -1069,7 +1069,7 @@ void CIrcProto::ConnectToServer(void) InterlockedIncrement((long *)&m_bConnectRequested);
TCHAR szTemp[300];
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("\033%s \002%s\002 (%S: %u)"),
+ mir_sntprintf(szTemp, _T("\033%s \002%s\002 (%S: %u)"),
TranslateT("Connecting to"), si.sNetwork.c_str(), si.sServer.c_str(), si.iPort);
DoEvent(GC_EVENT_INFORMATION, SERVERWINDOW, NULL, szTemp, NULL, NULL, NULL, true, false);
}
diff --git a/protocols/IRCG/src/tools.cpp b/protocols/IRCG/src/tools.cpp index 954665a01f..55dfc734f5 100644 --- a/protocols/IRCG/src/tools.cpp +++ b/protocols/IRCG/src/tools.cpp @@ -342,7 +342,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce *p++ = '%';
*p++ = 'c';
- mir_sntprintf(buf, SIZEOF(buf), _T("%02u"), iFG);
+ mir_sntprintf(buf, _T("%02u"), iFG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -355,7 +355,7 @@ TCHAR* __stdcall DoColorCodes(const TCHAR* text, bool bStrip, bool bReplacePerce *p++ = '%';
*p++ = 'f';
- mir_sntprintf(buf, SIZEOF(buf), _T("%02u"), iBG);
+ mir_sntprintf(buf, _T("%02u"), iBG);
for (int i = 0; i < 2; i++)
*p++ = buf[i];
}
@@ -548,7 +548,7 @@ int CIrcProto::SetChannelSBText(CMString sWindow, CHANNELINFO * wi) CMString CIrcProto::MakeWndID(const TCHAR* sWindow)
{
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s - %s"), sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
+ mir_sntprintf(buf, _T("%s - %s"), sWindow, (IsConnected()) ? m_info.sNetwork.c_str() : TranslateT("Offline"));
return CMString(buf);
}
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp index 51accea275..0de5d3b1b7 100644 --- a/protocols/IRCG/src/windows.cpp +++ b/protocols/IRCG/src/windows.cpp @@ -923,7 +923,7 @@ void CManagerDlg::OnClose() }
if (!S.IsEmpty() && m_proto->IsConnected()) {
- mir_sntprintf(temp, SIZEOF(temp), _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
m_proto->setTString(p, S.c_str());
mir_free(p);
@@ -1189,9 +1189,9 @@ void CManagerDlg::OnApplyModes(CCtrlButton*) mir_tstrcat(temp, window);
mir_tstrcat(temp, _T(" "));
if (mir_tstrlen(toremove))
- mir_sntprintf(temp, SIZEOF(temp), _T("%s-%s"), temp, toremove);
+ mir_sntprintf(temp, _T("%s-%s"), temp, toremove);
if (mir_tstrlen(toadd))
- mir_sntprintf(temp, SIZEOF(temp), _T("%s+%s"), temp, toadd);
+ mir_sntprintf(temp, _T("%s+%s"), temp, toadd);
if (!appendixremove.IsEmpty())
mir_tstrcat(temp, appendixremove.c_str());
if (!appendixadd.IsEmpty())
@@ -1278,7 +1278,7 @@ void CManagerDlg::InitManager(int mode, const TCHAR* window) if (wi) {
if (m_proto->IsConnected()) {
TCHAR temp[1000];
- mir_sntprintf(temp, SIZEOF(temp), _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
+ mir_sntprintf(temp, _T("Topic%s%s"), window, m_proto->m_info.sNetwork.c_str());
char* p = mir_t2a(temp);
diff --git a/protocols/IcqOscarJ/src/dlgproc.cpp b/protocols/IcqOscarJ/src/dlgproc.cpp index 041333468c..517463bfd8 100644 --- a/protocols/IcqOscarJ/src/dlgproc.cpp +++ b/protocols/IcqOscarJ/src/dlgproc.cpp @@ -475,7 +475,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM for (done = 0, i = 0; i < SIZEOF(dat->hUpload); i++)
done += dat->hUpload[i] == NULL;
TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload)));
+ mir_sntprintf(buf, TranslateT("Upload in progress...%d%%"), 100 * done / (SIZEOF(dat->hUpload)));
SetDlgItemText(hwndDlg, IDC_UPLOADING, buf);
if (done < SIZEOF(dat->hUpload)) break;
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 9e3e9ca250..bf14253fca 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -76,7 +76,7 @@ void CIcqProto::GetFullAvatarFileName(int dwUin, const char *szUid, int dwFormat void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, TCHAR *pszDest, size_t cbLen)
{
TCHAR szPath[MAX_PATH * 2];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
+ mir_sntprintf(szPath, _T("%s\\%S\\"), VARST(_T("%miranda_avatarcache%")), m_szModuleName);
FOLDERSGETDATA fgd = { sizeof(fgd) };
fgd.nMaxPathSize = SIZEOF(szPath);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index ff505dc1a4..25bb80d2c2 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -159,7 +159,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : // Register netlib users
NETLIBUSER nlu = { 0 };
TCHAR szBuffer[MAX_PATH + 64];
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s server connection"), m_tszUserName);
nlu.cbSize = sizeof(nlu);
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
@@ -174,7 +174,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const TCHAR* aUserName) : char szP2PModuleName[MAX_PATH];
mir_snprintf(szP2PModuleName, SIZEOF(szP2PModuleName), "%sP2P", m_szModuleName);
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s client-to-client connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s client-to-client connections"), m_tszUserName);
nlu.flags = NUF_OUTGOING | NUF_INCOMING | NUF_TCHAR;
nlu.ptszDescriptiveName = szBuffer;
nlu.szSettingsModule = szP2PModuleName;
diff --git a/protocols/IcqOscarJ/src/userinfotab.cpp b/protocols/IcqOscarJ/src/userinfotab.cpp index 00dd66fac1..b286579faf 100644 --- a/protocols/IcqOscarJ/src/userinfotab.cpp +++ b/protocols/IcqOscarJ/src/userinfotab.cpp @@ -279,7 +279,7 @@ int CIcqProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) if (!lParam) {
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s Details"), m_tszUserName);
+ mir_sntprintf(buf, TranslateT("%s Details"), m_tszUserName);
odp.ptszTitle = buf;
odp.position = -1899999999;
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 37160b7ad7..723b45a43a 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -154,7 +154,7 @@ int CJabberProto::AdHoc_OnJAHMCommandListResult(HWND hwndDlg, HXML iqNode, Jabbe code = xmlGetAttrValue(errorNode, _T("code"));
description = xmlGetText(errorNode);
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), (code) ? code : _T(""), (description) ? description : _T(""));
JabberFormSetInstruction(hwndDlg, buff);
}
else if (!mir_tstrcmp(type, _T("result"))) {
@@ -282,7 +282,7 @@ int CJabberProto::AdHoc_OnJAHMProcessResult(HWND hwndDlg, HXML workNode, JabberA code = xmlGetAttrValue(errorNode, _T("code"));
description = xmlGetText(errorNode);
}
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
+ mir_sntprintf(buff, TranslateT("Error %s %s"), code ? code : _T(""), description ? description : _T(""));
JabberFormSetInstruction(hwndDlg,buff);
}
JabberAdHoc_RefreshFrameScroll(hwndDlg, dat);
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index ffbc79d77f..914a528824 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -363,7 +363,7 @@ int CJabberProto::ByteSendParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char* b TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -512,7 +512,7 @@ int CJabberProto::ByteSendProxyParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, ch TCHAR *szInitiatorJid = JabberPrepareJid(jbt->srcJID);
TCHAR *szTargetJid = JabberPrepareJid(jbt->dstJID);
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
mir_free(szInitiatorJid);
mir_free(szTargetJid);
@@ -707,7 +707,7 @@ int CJabberProto::ByteReceiveParse(HANDLE hConn, JABBER_BYTE_TRANSFER *jbt, char {
ptrT szInitiatorJid(JabberPrepareJid(jbt->srcJID));
ptrT szTargetJid(JabberPrepareJid(jbt->dstJID));
- mir_sntprintf(text, SIZEOF(text), _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
+ mir_sntprintf(text, _T("%s%s%s"), jbt->sid, szInitiatorJid, szTargetJid);
}
T2Utf szAuthString(text);
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 4ac3010bea..6ecdb6548b 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -763,7 +763,7 @@ public: CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
cii.flags = CLCIIF_CHECKBOX;
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s (not on roster)"), jidData->jid);
+ mir_sntprintf(buf, TranslateT("%s (not on roster)"), jidData->jid);
cii.pszText = buf;
jidData->hItem = SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
SendDlgItemMessage(m_hwnd, IDC_CLIST, CLM_SETCHECKMARK, jidData->hItem, 1);
@@ -858,7 +858,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)LoadSkinnedProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
+ mir_sntprintf(buf, TranslateT("%s from\n%s"), dat->him->m_tszResourceName, dat->item->jid);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, buf);
SetDlgItemText(hwndDlg, IDC_TXT_NICK, dat->him->m_tszResourceName);
@@ -1017,7 +1017,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* // do not use snprintf to avoid possible problems with % symbol
if (TCHAR *p = _tcsstr(szMessage, _T("%s"))) {
*p = 0;
- mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
+ mir_sntprintf(buf, _T("%s%s%s"), szMessage, him->m_tszResourceName, p + 2);
}
else mir_tstrncpy(buf, szMessage, SIZEOF(buf));
UnEscapeChatTags(buf);
@@ -1272,7 +1272,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g if (ppro->EnterString(szBuffer, szTitle, ESF_COMBO, "gcNick_")) {
if (ppro->ListGetItemPtr(LIST_CHATROOM, gch->pDest->ptszID) != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), gch->pDest->ptszID, szBuffer);
+ mir_sntprintf(text, _T("%s/%s"), gch->pDest->ptszID, szBuffer);
ppro->SendPresenceTo(ppro->m_iStatus == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : ppro->m_iStatus, text, NULL);
}
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 81b37b400e..14aadd27d8 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -246,7 +246,7 @@ void CJabberProto::GroupchatJoinRoom(const TCHAR *server, const TCHAR *room, con }
TCHAR text[JABBER_MAX_JID_LEN + 1];
- mir_sntprintf(text, SIZEOF(text), _T("%s@%s/%s"), room, server, nick);
+ mir_sntprintf(text, _T("%s@%s/%s"), room, server, nick);
JABBER_LIST_ITEM *item = ListAdd(LIST_CHATROOM, text);
item->bAutoJoin = autojoin;
@@ -1011,7 +1011,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node) if (++item->iChatState == 1 && newNick != NULL && newNick[0] != 0) {
replaceStrT(item->nick, newNick);
TCHAR text[1024] = { 0 };
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, newNick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, newNick);
SendPresenceTo(m_iStatus, text, NULL);
}
else {
@@ -1164,7 +1164,7 @@ public: CSuper::OnInitDialog();
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Group chat invitation to\n%s"), m_info->roomJid);
+ mir_sntprintf(buf, TranslateT("Group chat invitation to\n%s"), m_info->roomJid);
SetDlgItemText(m_hwnd, IDC_HEADERBAR, buf);
SetDlgItemText(m_hwnd, IDC_FROM, m_info->from);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 252da69c2f..d239ae052c 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -311,7 +311,7 @@ BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE) }
TCHAR buf[80];
- mir_sntprintf(buf, SIZEOF(buf), TEXT(" (build %d)"), osvi.dwBuildNumber);
+ mir_sntprintf(buf, TEXT(" (build %d)"), osvi.dwBuildNumber);
StringCchCat(pszOS, BUFSIZE, buf);
return TRUE;
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index eaa7edc593..38712cd0c1 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -239,7 +239,7 @@ void CJabberProto::OnIqResultGetAuth(HXML iqNode, CJabberIqInfo*) m_ThreadInfo->send("</stream:stream>");
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -266,7 +266,7 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode, CJabberIqInfo*) TCHAR text[128];
m_ThreadInfo->send("</stream:stream>");
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s."), m_ThreadInfo->conn.username);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
m_ThreadInfo = NULL; // To disallow auto reconnect
@@ -815,9 +815,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasHomeStreet = true;
if (hContact != NULL) {
if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else
_tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
text[SIZEOF(text)-1] = '\0';
@@ -858,9 +858,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode, CJabberIqInfo*) hasWorkStreet = true;
if (hContact != NULL) {
if ((o=xmlGetChild(n, "EXTADR")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else if ((o=xmlGetChild(n, "EXTADD")) != NULL && xmlGetText(o) != NULL)
- mir_sntprintf(text, SIZEOF(text), _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
+ mir_sntprintf(text, _T("%s\r\n%s"), xmlGetText(m), xmlGetText(o));
else
_tcsncpy_s(text, xmlGetText(m), _TRUNCATE);
text[SIZEOF(text)-1] = '\0';
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 79335a9182..b5c762af08 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -748,11 +748,11 @@ void CJabberProto::MenuInit() mir_snprintf(srvFce, SIZEOF(srvFce), "%s/menuSetPriority/%d", m_szModuleName, steps[i]);
if (steps[i] > 0) {
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Increase priority by %d"), steps[i]);
+ mir_sntprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
mi.icolibItem = GetIconHandle(IDI_ARROW_UP);
}
else {
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Decrease priority by %d"), -steps[i]);
+ mir_sntprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
mi.icolibItem = GetIconHandle(IDI_ARROW_DOWN);
}
@@ -796,7 +796,7 @@ void CJabberProto::UpdatePriorityMenu(short priority) return;
TCHAR szName[128];
- mir_sntprintf(szName, SIZEOF(szName), TranslateT("Resource priority [%d]"), (int)priority);
+ mir_sntprintf(szName, TranslateT("Resource priority [%d]"), (int)priority);
CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIF_TCHAR | CMIM_NAME | CMIF_KEEPUNTRANSLATED;
@@ -1036,7 +1036,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM hContact, LPARAM lParam) HMENU hMenu = CreatePopupMenu();
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Last active (%s)"),
+ mir_sntprintf(buf, TranslateT("Last active (%s)"),
LI->m_pLastSeenResource ? LI->m_pLastSeenResource->m_tszResourceName : TranslateT("No activity yet, use server's choice"));
AppendMenu(hMenu, MF_STRING, MENUITEM_LASTSEEN, buf);
@@ -1121,7 +1121,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM hContact, LPARAM if (item == NULL)
return 0;
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
jid = text;
}
else jid = tszJid;
diff --git a/protocols/JabberG/src/jabber_message_handlers.cpp b/protocols/JabberG/src/jabber_message_handlers.cpp index aabdec3b57..77e900c76e 100644 --- a/protocols/JabberG/src/jabber_message_handlers.cpp +++ b/protocols/JabberG/src/jabber_message_handlers.cpp @@ -44,9 +44,9 @@ BOOL CJabberProto::OnMessageError(HXML node, ThreadData*, CJabberMessageInfo* pI TCHAR buf[512];
HXML bodyNode = xmlGetChild(node, "body");
if (bodyNode)
- mir_sntprintf(buf, SIZEOF(buf), _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s\n%s"), pInfo->GetFrom(), xmlGetText(bodyNode), szErrText);
else
- mir_sntprintf(buf, SIZEOF(buf), _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
+ mir_sntprintf(buf, _T("%s:\n%s"), pInfo->GetFrom(), szErrText);
MsgPopup(NULL, buf, TranslateT("Jabber Error"));
}
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index e493e54c0d..a6800722c8 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -377,7 +377,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("From: %s"), pNote->GetFrom());
+ mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rc.top += DrawText(hdc, buf, -1, &rc, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS);
}
rc.top += DrawText(hdc, pNote->GetText(), -1, &rc, DT_NOPREFIX | DT_WORDBREAK | DT_EXPANDTABS | DT_END_ELLIPSIS);
@@ -412,7 +412,7 @@ public: SelectObject(hdc, m_hfntNormal);
if (pNote->GetFrom()) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("From: %s"), pNote->GetFrom());
+ mir_sntprintf(buf, TranslateT("From: %s"), pNote->GetFrom());
rcTmp = rc;
DrawText(hdc, buf, -1, &rcTmp, DT_NOPREFIX | DT_SINGLELINE | DT_END_ELLIPSIS | DT_CALCRECT);
lps->itemHeight += rcTmp.bottom;
@@ -729,7 +729,7 @@ void CJabberProto::ProcessOutgoingNote(CNoteItem *pNote, bool ok) }
TCHAR buf[1024];
- mir_sntprintf(buf, SIZEOF(buf), _T("Incoming note: %s\n\n%s\nTags: %s"),
+ mir_sntprintf(buf, _T("Incoming note: %s\n\n%s\nTags: %s"),
pNote->GetTitle(), pNote->GetText(), pNote->GetTagsStr());
JabberCapsBits jcb = GetResourceCapabilites(pNote->GetFrom(), TRUE);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index bdf8e06dc0..df53cb80f4 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -243,7 +243,7 @@ protected: void OnInitDialog()
{
TCHAR text[256];
- mir_sntprintf(text, SIZEOF(text), STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
+ mir_sntprintf(text, STR_FORMAT, TranslateT("Register"), m_regInfo->username, m_regInfo->server, m_regInfo->port);
SetDlgItemText(m_hwnd, IDC_REG_STATUS, text);
}
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 494b685230..e36ed79c55 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -50,7 +50,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR TranslateDialogDefault(hwndDlg);
if (ppro->m_bJabberOnline && ppro->m_ThreadInfo != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
+ mir_sntprintf(text, TranslateT("Set New Password for %s@%S"), ppro->m_ThreadInfo->conn.username, ppro->m_ThreadInfo->conn.server);
SetWindowText(hwndDlg, text);
}
return TRUE;
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 2169b02f1d..2b7309779f 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -58,9 +58,9 @@ void CJabberProto::OnIqResultPrivacyListModify(HXML, CJabberIqInfo *pInfo) if (!pParam->m_dwCount) {
TCHAR szText[ 512 ];
if (!pParam->m_bAllOk)
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Error occurred while applying changes"));
+ mir_sntprintf(szText, TranslateT("Error occurred while applying changes"));
else
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Privacy lists successfully saved"));
+ mir_sntprintf(szText, TranslateT("Privacy lists successfully saved"));
if (m_pDlgPrivacyLists)
m_pDlgPrivacyLists->SetStatusText(szText);
// FIXME: enable apply button
@@ -226,14 +226,14 @@ void CJabberProto::OnIqResultPrivacyListDefault(HXML iqNode, CJabberIqInfo *pInf CPrivacyList *pList = (CPrivacyList *)pInfo->GetUserData();
if (pList) {
m_privacyListManager.SetDefaultListName(pList->GetListName());
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Privacy list %s set as default"), pList->GetListName());
+ mir_sntprintf(szText, TranslateT("Privacy list %s set as default"), pList->GetListName());
}
else {
m_privacyListManager.SetDefaultListName(NULL);
- mir_sntprintf(szText, SIZEOF(szText), TranslateT("Default privacy list successfully declined"));
+ mir_sntprintf(szText, TranslateT("Default privacy list successfully declined"));
}
}
- else mir_sntprintf(szText, SIZEOF(szText), TranslateT("Error occurred while setting default list"));
+ else mir_sntprintf(szText, TranslateT("Error occurred while setting default list"));
}
if (m_pDlgPrivacyLists) {
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 06cd7a8fa2..af1ebda659 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -192,7 +192,7 @@ void CJabberProto::OnIqResultGetSearchFields(HXML iqNode, CJabberIqInfo*) code = xmlGetAttrValue(errorNode, _T("code")); description = xmlGetText(errorNode); } - mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T("")); + mir_sntprintf(buff, TranslateT("Error %s %s\r\nPlease select other server"), code ? code : _T(""), description ? description : _T("")); SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); } else SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, TranslateT("Error: unknown reply received\r\nPlease select other server")); @@ -271,7 +271,7 @@ void CJabberProto::SearchReturnResults(HANDLE id, void * pvUsersInfo, U_TCHAR_M if (nick) { if (mir_tstrcmpi(nick, Results.psr.id.t)) - mir_sntprintf(buff, SIZEOF(buff), _T("%s (%s)"), nick, Results.psr.id.t); + mir_sntprintf(buff, _T("%s (%s)"), nick, Results.psr.id.t); else _tcsncpy_s(buff, nick, _TRUNCATE); @@ -389,7 +389,7 @@ void CJabberProto::OnIqResultAdvancedSearch(HXML iqNode, CJabberIqInfo*) description = xmlGetText(errorNode); } - mir_sntprintf(buff, SIZEOF(buff), TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T("")); + mir_sntprintf(buff, TranslateT("Error %s %s\r\nTry to specify more detailed"), code ? code : _T(""), description ? description : _T("")); ProtoBroadcastAck(NULL, ACKTYPE_SEARCH, ACKRESULT_SUCCESS, (HANDLE)id, 0); if (searchHandleDlg) SetDlgItemText(searchHandleDlg, IDC_INSTRUCTIONS, buff); diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index c7a1354fa1..cd3e8d0d18 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -77,7 +77,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
TCHAR text[512];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Enter password for %s"), param->ptszJid);
+ mir_sntprintf(text, TranslateT("Enter password for %s"), param->ptszJid);
SetDlgItemText(hwndDlg, IDC_JID, text);
int bSavePassword = param->pro->getByte("SaveSessionPassword", 0);
@@ -651,7 +651,7 @@ void CJabberProto::PerformAuthentication(ThreadData *info) }
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
+ mir_sntprintf(text, TranslateT("Authentication failed for %s@%S."), info->conn.username, info->conn.server);
MsgPopup(NULL, text, TranslateT("Jabber Authentication"));
JLoginFailed(LOGINERR_WRONGPASSWORD);
info->send("</stream:stream>");
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index d3958b3436..7ac15547a1 100644 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -174,7 +174,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon, TCHAR buf[256]; if (title) - mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), title, value); + mir_sntprintf(buf, _T("%s: %s"), title, value); else mir_tstrncpy(buf, value, SIZEOF(buf)); @@ -227,7 +227,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti HICON hIcon = NULL; if ( ServiceExists(MS_FP_GETCLIENTICONT)) { if (r->m_tszSoftware != NULL) { - mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion); + mir_sntprintf(buf, _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion); hIcon = Finger_GetClientIcon(buf, 0); } } @@ -269,7 +269,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE)); // caps - mir_sntprintf(buf, SIZEOF(buf), _T("%s/%s"), item->jid, r->m_tszResourceName); + mir_sntprintf(buf, _T("%s/%s"), item->jid, r->m_tszResourceName); JabberCapsBits jcb = ppro->GetResourceCapabilites(buf, TRUE); if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) { @@ -320,7 +320,7 @@ static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM ht if (szAdvStatusIcon && szAdvStatusTitle && *szAdvStatusTitle) { TCHAR szText[2048]; if (szAdvStatusText && *szAdvStatusText) - mir_sntprintf(szText, SIZEOF(szText), _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText); + mir_sntprintf(szText, _T("%s (%s)"), TranslateTS(szAdvStatusTitle), szAdvStatusText); else _tcsncpy_s(szText, TranslateTS(szAdvStatusTitle), _TRUNCATE); sttFillInfoLine(hwndTree, htiRoot, Skin_GetIcon(szAdvStatusIcon), szTitle, szText, dwInfoLine); @@ -498,7 +498,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case WM_CONTEXTMENU: if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TV_INFO) { HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO); - POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
+ POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; HTREEITEM hItem = 0; if ((pt.x == -1) && (pt.y == -1)) { @@ -678,19 +678,19 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP switch (ProtoGetAvatarFileFormat(item->photoFileName)) { case PA_FORMAT_BMP: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("BMP %s (*.bmp)%c*.BMP"), TranslateT("format"), 0); break; case PA_FORMAT_GIF: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("GIF %s (*.gif)%c*.GIF"), TranslateT("format"), 0); break; case PA_FORMAT_JPEG: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0); + mir_sntprintf(szFilter, _T("JPEG %s (*.jpg;*.jpeg)%c*.JPG;*.JPEG"), TranslateT("format"), 0); break; default: - mir_sntprintf(szFilter, SIZEOF(szFilter), _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0); + mir_sntprintf(szFilter, _T("%s (*.*)%c*.*"), TranslateT("Unknown format"), 0); } TCHAR szFileName[MAX_PATH]; szFileName[0] = '\0'; diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 662240451c..ded31eb3ef 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -528,7 +528,7 @@ void CJabberProto::SendPresence(int status, bool bSendToAll) JABBER_LIST_ITEM *item = ListGetItemPtrFromIndex(i);
if (item != NULL) {
TCHAR text[1024];
- mir_sntprintf(text, SIZEOF(text), _T("%s/%s"), item->jid, item->nick);
+ mir_sntprintf(text, _T("%s/%s"), item->jid, item->nick);
SendPresenceTo(status == ID_STATUS_INVISIBLE ? ID_STATUS_ONLINE : status, text, NULL);
}
}
@@ -551,7 +551,7 @@ int __stdcall JabberGetPacketID(HXML n) TCHAR* __stdcall JabberId2string(int id)
{
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), _T(JABBER_IQID) _T("%d"), id);
+ mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
return mir_tstrdup(text);
}
diff --git a/protocols/JabberG/src/jabber_xml.cpp b/protocols/JabberG/src/jabber_xml.cpp index 616ee41f0f..0d75e02496 100644 --- a/protocols/JabberG/src/jabber_xml.cpp +++ b/protocols/JabberG/src/jabber_xml.cpp @@ -154,7 +154,7 @@ void __fastcall xmlAddAttr(HXML hXml, LPCTSTR pszName, unsigned __int64 value) void __fastcall xmlAddAttrID(HXML hXml, int id)
{
TCHAR text[100];
- mir_sntprintf(text, SIZEOF(text), _T(JABBER_IQID) _T("%d"), id);
+ mir_sntprintf(text, _T(JABBER_IQID) _T("%d"), id);
xmlAddAttr(hXml, _T("id"), text);
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 473f0b5292..a6351238ba 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -68,7 +68,7 @@ void CJabberDlgPepBase::OnInitDialog() SetTimer(m_hwnd, 1, 1000, NULL);
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), m_time);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), m_time);
m_btnOk.SetText(buf);
}
@@ -89,7 +89,7 @@ INT_PTR CJabberDlgPepBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) case WM_TIMER:
if (wParam == 1) {
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), --m_time);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), --m_time);
m_btnOk.SetText(buf);
if (m_time < 0) {
@@ -341,7 +341,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) if (mode->m_subitem) {
for (int i = lpdis->itemData; i >= 0; --i)
if (!m_modes[i].m_subitem) {
- mir_sntprintf(text, SIZEOF(text), _T("%s [%s]"), m_modes[i].m_title, mode->m_title);
+ mir_sntprintf(text, _T("%s [%s]"), m_modes[i].m_title, mode->m_title);
break;
}
}
@@ -352,7 +352,7 @@ BOOL CJabberDlgPepSimple::OnWmDrawItem(UINT, WPARAM, LPARAM lParam) }
else {
TCHAR text[128];
- mir_sntprintf(text, SIZEOF(text), _T("...%s"), mode->m_title);
+ mir_sntprintf(text, _T("...%s"), mode->m_title);
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 23, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2, mode->m_hIcon, 16, 16, 0, NULL, DI_NORMAL);
TextOut(lpdis->hDC, lpdis->rcItem.left + 44, (lpdis->rcItem.top + lpdis->rcItem.bottom - tm.tmHeight) / 2, text, (int)mir_tstrlen(text));
}
diff --git a/protocols/MRA/src/MraAvatars.cpp b/protocols/MRA/src/MraAvatars.cpp index 28f74a6c45..fc53c18d8e 100644 --- a/protocols/MRA/src/MraAvatars.cpp +++ b/protocols/MRA/src/MraAvatars.cpp @@ -56,7 +56,7 @@ DWORD CMraProto::MraAvatarsQueueInitialize(HANDLE *phAvatarsQueueHandle) MRA_AVATARS_QUEUE *pmraaqAvatarsQueue = new MRA_AVATARS_QUEUE();
TCHAR szBuffer[MAX_PATH];
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s %s"), m_tszUserName, TranslateT("Avatars' plugin connections"));
+ mir_sntprintf(szBuffer, _T("%s %s"), m_tszUserName, TranslateT("Avatars' plugin connections"));
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
diff --git a/protocols/MSN/src/msn_chat.cpp b/protocols/MSN/src/msn_chat.cpp index 396cb4aae2..6920312d4f 100644 --- a/protocols/MSN/src/msn_chat.cpp +++ b/protocols/MSN/src/msn_chat.cpp @@ -55,7 +55,7 @@ int CMsnProto::MSN_ChatInit(GCThreadData *info, const char *pszID, const char *p TCHAR szName[512];
InterlockedIncrement(&m_chatID);
if (*pszTopic) _tcsncpy(szName, _A2T(pszTopic), SIZEOF(szName));
- else mir_sntprintf(szName, SIZEOF(szName), _T("%s %s%d"),
+ else mir_sntprintf(szName, _T("%s %s%d"),
m_tszUserName, TranslateT("Chat #"), m_chatID);
GCSESSION gcw = { sizeof(gcw) };
diff --git a/protocols/MSN/src/msn_commands.cpp b/protocols/MSN/src/msn_commands.cpp index 7d0eeac2a5..c65359a54a 100644 --- a/protocols/MSN/src/msn_commands.cpp +++ b/protocols/MSN/src/msn_commands.cpp @@ -1501,7 +1501,7 @@ void CMsnProto::MSN_InviteMessage(ThreadData* info, char* msgBody, char* email, // netmeeting receive 1
if (Appname != NULL && !_stricmp(Appname, "NetMeeting")) {
TCHAR text[512], *tszEmail = mir_a2t(email);
- mir_sntprintf(text, SIZEOF(text), TranslateT("Accept NetMeeting request from %s?"), tszEmail);
+ mir_sntprintf(text, TranslateT("Accept NetMeeting request from %s?"), tszEmail);
mir_free(tszEmail);
if (MessageBox(NULL, text, TranslateT("MSN Protocol"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index b58e6c36a8..22c1f57fde 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -239,7 +239,7 @@ void CMsnProto::MSN_CleanupLists(void) if (count) {
TCHAR text[256];
TCHAR *sze = mir_a2t(p.email);
- mir_sntprintf(text, SIZEOF(text), TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
+ mir_sntprintf(text, TranslateT("Contact %s has been removed from the server.\nWould you like to keep it as \"Local Only\" contact to preserve history?"), sze);
mir_free(sze);
TCHAR title[128];
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp index 195f7a4303..bde4541e40 100644 --- a/protocols/MSN/src/msn_proto.cpp +++ b/protocols/MSN/src/msn_proto.cpp @@ -130,7 +130,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu1.ptszDescriptiveName = szBuffer;
mir_snprintf(szDbsettings, SIZEOF(szDbsettings), "%s_HTTPS", m_szModuleName);
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin HTTPS connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s plugin HTTPS connections"), m_tszUserName);
hNetlibUserHttps = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu1);
NETLIBUSER nlu = { 0 };
@@ -144,7 +144,7 @@ CMsnProto::CMsnProto(const char* aProtoName, const TCHAR* aUserName) : nlu.pfnHttpGatewayWrapSend = msn_httpGatewayWrapSend;
nlu.pfnHttpGatewayUnwrapRecv = msn_httpGatewayUnwrapRecv;
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), TranslateT("%s plugin connections"), m_tszUserName);
+ mir_sntprintf(szBuffer, TranslateT("%s plugin connections"), m_tszUserName);
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
m_DisplayNameCache = NULL;
diff --git a/protocols/MinecraftDynmap/src/proto.cpp b/protocols/MinecraftDynmap/src/proto.cpp index 7400223e38..5a354daa00 100644 --- a/protocols/MinecraftDynmap/src/proto.cpp +++ b/protocols/MinecraftDynmap/src/proto.cpp @@ -45,12 +45,12 @@ MinecraftDynmapProto::MinecraftDynmapProto(const char* proto_name, const TCHAR* NETLIBUSER nlu = {sizeof(nlu)}; nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR; nlu.szSettingsModule = m_szModuleName; - mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName); + mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName); nlu.ptszDescriptiveName = descr; m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu); if (m_hNetlibUser == NULL) { TCHAR error[200]; - mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); + mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName); MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR); } diff --git a/protocols/Omegle/src/proto.cpp b/protocols/Omegle/src/proto.cpp index fa5a0a7d04..7419a9dcb8 100644 --- a/protocols/Omegle/src/proto.cpp +++ b/protocols/Omegle/src/proto.cpp @@ -52,7 +52,7 @@ OmegleProto::OmegleProto(const char* proto_name, const TCHAR* username) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER,0,(LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/Sametime/src/sametime_session.cpp b/protocols/Sametime/src/sametime_session.cpp index 828e8808db..d8e146447e 100644 --- a/protocols/Sametime/src/sametime_session.cpp +++ b/protocols/Sametime/src/sametime_session.cpp @@ -213,7 +213,7 @@ void __cdecl SessionSetUserStatus(struct mwSession* session) default:
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Unknown user status: %d"), us.status);
+ mir_sntprintf(buff, TranslateT("Unknown user status: %d"), us.status);
proto->showPopup(buff, SAMETIME_POPUP_ERROR);
proto->debugLog(buff);
diff --git a/protocols/Sametime/src/utils.cpp b/protocols/Sametime/src/utils.cpp index eeccb5a661..1d464b16a1 100644 --- a/protocols/Sametime/src/utils.cpp +++ b/protocols/Sametime/src/utils.cpp @@ -144,13 +144,13 @@ void CSametimeProto::showPopup(guint32 code) SametimePopupEnum flag = (rcDesc->type == mwReturnCodeError ? SAMETIME_POPUP_ERROR : SAMETIME_POPUP_INFO);
TCHAR buff[512];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
+ mir_sntprintf(buff, TranslateT("%s\n\nSametime error %S\n%s"), TranslateTS(_A2T(rcDesc->name)), rcDesc->codeString, TranslateTS(_A2T(rcDesc->description)));
showPopup(buff, flag);
debugLog(buff);
- g_free(rcDesc->codeString); - g_free(rcDesc->name); + g_free(rcDesc->codeString);
+ g_free(rcDesc->name);
g_free(rcDesc->description);
g_free(rcDesc);
}
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp index b2992b22f4..752a3f78a2 100644 --- a/protocols/Twitter/src/proto.cpp +++ b/protocols/Twitter/src/proto.cpp @@ -321,12 +321,12 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) nlu.szSettingsModule = m_szModuleName;
// Create standard network connection
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
@@ -334,12 +334,12 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM) char module[512];
mir_snprintf(module, SIZEOF(module), "%sAv", m_szModuleName);
nlu.szSettingsModule = module;
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s avatar connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s avatar connection"), m_tszUserName);
nlu.ptszDescriptiveName = descr;
hAvatarNetlib_ = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (hAvatarNetlib_ == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), TranslateT("Twitter (avatars)"));
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/VKontakte/src/vk_proto.cpp b/protocols/VKontakte/src/vk_proto.cpp index 28f0e88289..a09c0b35e0 100644 --- a/protocols/VKontakte/src/vk_proto.cpp +++ b/protocols/VKontakte/src/vk_proto.cpp @@ -52,7 +52,7 @@ CVkProto::CVkProto(const char *szModuleName, const TCHAR *ptszUserName) : HookProtoEvent(ME_OPT_INITIALISE, &CVkProto::OnOptionsInit);
TCHAR descr[512];
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = {sizeof(nlu)};
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 9b89beeaa1..780bd12159 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -34,7 +34,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : // Create standard network connection
TCHAR descr[512];
- mir_sntprintf(descr, SIZEOF(descr), TranslateT("%s server connection"), m_tszUserName);
+ mir_sntprintf(descr, TranslateT("%s server connection"), m_tszUserName);
NETLIBUSER nlu = { sizeof(nlu) };
nlu.flags = NUF_INCOMING | NUF_OUTGOING | NUF_HTTPCONNS | NUF_TCHAR;
@@ -43,7 +43,7 @@ WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : m_hNetlibUser = (HANDLE)CallService(MS_NETLIB_REGISTERUSER, 0, (LPARAM)&nlu);
if (m_hNetlibUser == NULL) {
TCHAR error[200];
- mir_sntprintf(error, SIZEOF(error), TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
+ mir_sntprintf(error, TranslateT("Unable to initialize Netlib for %s."), m_tszUserName);
MessageBox(NULL, error, _T("Miranda NG"), MB_OK | MB_ICONERROR);
}
diff --git a/protocols/Yahoo/src/yahoo.cpp b/protocols/Yahoo/src/yahoo.cpp index 58c9089d4d..c0e8dee551 100644 --- a/protocols/Yahoo/src/yahoo.cpp +++ b/protocols/Yahoo/src/yahoo.cpp @@ -670,7 +670,7 @@ void CYahooProto::ext_rejected(const char *who, const char *msg) ptrT tszMsg( mir_utf8decodeT(msg));
TCHAR buff[1024];
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
+ mir_sntprintf(buff, TranslateT("%s has rejected your request and sent the following message:"), (TCHAR*)tszWho);
MessageBox(NULL, tszMsg, buff, MB_OK | MB_ICONINFORMATION );
}
@@ -1056,33 +1056,33 @@ void CYahooProto::ext_login_response(int succ, const char *url) }
if (succ == YAHOO_LOGIN_UNAME) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service - username not recognized. Please verify that your username is correctly typed."));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service - username not recognized. Please verify that your username is correctly typed."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_BADUSERID);
}
else if (succ == YAHOO_LOGIN_PASSWD) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service - password incorrect. Please verify that your username and password are correctly typed."));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service - password incorrect. Please verify that your username and password are correctly typed."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_WRONGPASSWORD);
}
else if (succ == YAHOO_LOGIN_LOCK) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log into Yahoo service. Your account has been locked.\nVisit %s to reactivate it."), _A2T(url));
+ mir_sntprintf(buff, TranslateT("Could not log into Yahoo service. Your account has been locked.\nVisit %s to reactivate it."), _A2T(url));
}
else if (succ == YAHOO_LOGIN_DUPL) {
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("You have been logged out of the Yahoo service, possibly due to a duplicate login."));
+ mir_sntprintf(buff, TranslateT("You have been logged out of the Yahoo service, possibly due to a duplicate login."));
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
}
else if (succ == YAHOO_LOGIN_LOGOFF) {
- //mir_sntprintf(buff, SIZEOF(buff), TranslateT("You have been logged out of the Yahoo service."));
+ //mir_sntprintf(buff, TranslateT("You have been logged out of the Yahoo service."));
//ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, LOGINERR_OTHERLOCATION);
return; // we logged out.. so just sign-off..
}
else if (succ == -1) {
/// Can't Connect or got disconnected.
if (m_iStatus == ID_STATUS_CONNECTING)
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not connect to the Yahoo service. Check your server/port and proxy settings."));
+ mir_sntprintf(buff, TranslateT("Could not connect to the Yahoo service. Check your server/port and proxy settings."));
else
return;
}
- else mir_sntprintf(buff, SIZEOF(buff), TranslateT("Could not log in, unknown reason: %d."), succ);
+ else mir_sntprintf(buff, TranslateT("Could not log in, unknown reason: %d."), succ);
delSetting(YAHOO_PWTOKEN);
@@ -1108,28 +1108,28 @@ void CYahooProto::ext_error(const char *err, int fatal, int num) switch(num) {
case E_UNKNOWN:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Unknown error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Unknown error %s"), (TCHAR*)tszErr);
break;
case E_CUSTOM:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Custom error %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Custom error %s"), (TCHAR*)tszErr);
break;
case E_CONFNOTAVAIL:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is not available for the conference"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not available for the conference"), (TCHAR*)tszErr);
break;
case E_IGNOREDUP:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is already ignored"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is already ignored"), (TCHAR*)tszErr);
break;
case E_IGNORENONE:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is not in the ignore list"), (TCHAR*)tszErr);
break;
case E_IGNORECONF:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("%s is in buddy list - cannot ignore"), (TCHAR*)tszErr);
break;
case E_SYSTEM:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("System Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("System Error: %s"), (TCHAR*)tszErr);
break;
case E_CONNECTION:
- mir_sntprintf(buff, SIZEOF(buff), TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
+ mir_sntprintf(buff, TranslateT("Server Connection Error: %s"), (TCHAR*)tszErr);
debugLogA("Error: %S", buff);
return;
}
diff --git a/src/core/stdchat/src/tools.cpp b/src/core/stdchat/src/tools.cpp index 284499ef98..3537b61689 100644 --- a/src/core/stdchat/src/tools.cpp +++ b/src/core/stdchat/src/tools.cpp @@ -144,7 +144,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO else if (iIndex == 0) {
TCHAR szTemp[50];
if (pszWordText)
- mir_sntprintf(szTemp, SIZEOF(szTemp), TranslateT("&Message %s"), pszWordText);
+ mir_sntprintf(szTemp, TranslateT("&Message %s"), pszWordText);
else
mir_tstrncpy(szTemp, TranslateT("&Message"), SIZEOF(szTemp) - 1);
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index e8e9071dd4..a710d2be23 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -1315,17 +1315,17 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam) TCHAR szTemp[100];
switch(si->iType) {
case GCW_CHATROOM:
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: chat room (%u user)") : TranslateT("%s: chat room (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_PRIVMESS:
- mir_sntprintf(szTemp, SIZEOF(szTemp),
+ mir_sntprintf(szTemp,
(si->nUsersInNicklist == 1) ? TranslateT("%s: message session") : TranslateT("%s: message session (%u users)"),
si->ptszName, si->nUsersInNicklist);
break;
case GCW_SERVER:
- mir_sntprintf(szTemp, SIZEOF(szTemp), _T("%s: Server"), si->ptszName);
+ mir_sntprintf(szTemp, _T("%s: Server"), si->ptszName);
break;
}
SetWindowText(hwndDlg, szTemp);
@@ -2436,7 +2436,7 @@ LABEL_SHOWWINDOW: ValidateFilename(szName);
mir_sntprintf(szFolder, SIZEOF(szFolder), _T("%s\\%s"), g_Settings.pszLogDir, szName);
- mir_sntprintf(szName, SIZEOF(szName), _T("%s.log"), si->ptszID);
+ mir_sntprintf(szName, _T("%s.log"), si->ptszID);
ValidateFilename(szName);
mir_sntprintf(szFile, SIZEOF(szFile), _T("%s\\%s"), szFolder, szName);
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index a04e8ee3ca..5b04d948dc 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -96,12 +96,12 @@ static void AddToFileList(TCHAR ***pppFiles, int *totalCount, const TCHAR* szFil if (GetFileAttributes(szFilename) & FILE_ATTRIBUTE_DIRECTORY) {
WIN32_FIND_DATA fd;
TCHAR szPath[MAX_PATH];
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\*"), szFilename);
+ mir_sntprintf(szPath, _T("%s\\*"), szFilename);
HANDLE hFind = FindFirstFile(szPath, &fd);
if (hFind != INVALID_HANDLE_VALUE) {
do {
if (!mir_tstrcmp(fd.cFileName, _T(".")) || !mir_tstrcmp(fd.cFileName, _T(".."))) continue;
- mir_sntprintf(szPath, SIZEOF(szPath), _T("%s\\%s"), szFilename, fd.cFileName);
+ mir_sntprintf(szPath, _T("%s\\%s"), szFilename, fd.cFileName);
AddToFileList(pppFiles, totalCount, szPath);
}
while (FindNextFile(hFind, &fd));
@@ -122,7 +122,7 @@ static void UpdateReadChars(HWND hwndDlg, HWND hwndStatus) TCHAR buf[32];
int len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), len);
+ mir_sntprintf(buf, _T("%d"), len);
SendMessage(hwndStatus, SB_SETTEXT, 1, (LPARAM)buf);
}
}
@@ -955,7 +955,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP break;
case CNFT_DWORD:
- mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.dVal);
+ mir_sntprintf(buf, _T("%u"), ci.dVal);
break;
}
}
@@ -1061,7 +1061,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP mir_free(ci.pszVal);
break;
case CNFT_DWORD:
- mir_sntprintf(buf, SIZEOF(buf), _T("%u"), ci.dVal);
+ mir_sntprintf(buf, _T("%u"), ci.dVal);
break;
}
}
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index d4c69d53c0..fc87ed95fb 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -2369,7 +2369,7 @@ void CCtrlBase::SetTextA(const char *text) void CCtrlBase::SetInt(int value)
{
TCHAR buf[32] = { 0 };
- mir_sntprintf(buf, SIZEOF(buf), _T("%d"), value);
+ mir_sntprintf(buf, _T("%d"), value);
SetWindowText(m_hwnd, buf);
}
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;
}
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp index 74207f06e8..f82cfa27a7 100644 --- a/src/modules/clist/clcutils.cpp +++ b/src/modules/clist/clcutils.cpp @@ -59,7 +59,7 @@ TCHAR* fnGetGroupCountsText(struct ClcData *dat, ClcContact *contact) return _T("");
static TCHAR szName[32];
- mir_sntprintf(szName, SIZEOF(szName), _T("(%u/%u)"), onlineCount, totalCount);
+ mir_sntprintf(szName, _T("(%u/%u)"), onlineCount, totalCount);
return szName;
}
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp index b81968aee8..a2ab028c3a 100644 --- a/src/modules/clist/clistmenus.cpp +++ b/src/modules/clist/clistmenus.cpp @@ -555,7 +555,7 @@ INT_PTR StatusMenuExecService(WPARAM wParam, LPARAM) if (bIsLocked) {
pimi->mi.flags |= CMIF_CHECKED;
if (cli.bDisplayLocked) {
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s (locked)"), acc->tszAccountName);
+ mir_sntprintf(buf, TranslateT("%s (locked)"), acc->tszAccountName);
ptszName = buf;
}
else ptszName = acc->tszAccountName;
@@ -974,7 +974,7 @@ void RebuildMenuOrder(void) TCHAR buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\t%s"),
+ mir_sntprintf(buf, _T("%s\t%s"),
cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
tmi.ptszName = buf;
tmi.hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey));
@@ -1004,7 +1004,7 @@ static int sttRebuildHotkeys(WPARAM, LPARAM) TCHAR buf[256], hotkeyName[100];
WORD hotKey = GetHotkeyValue(statusHotkeys[j]);
HotkeyToName(hotkeyName, SIZEOF(hotkeyName), HIBYTE(hotKey), LOBYTE(hotKey));
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\t%s"), cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
+ mir_sntprintf(buf, _T("%s\t%s"), cli.pfnGetStatusModeDescription(statusModeList[j], 0), hotkeyName);
tmi.ptszName = buf;
tmi.hotKey = MAKELONG(HIBYTE(hotKey), LOBYTE(hotKey));
MO_ModifyMenuItem(hStatusMainMenuHandles[j], &tmi);
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp index c0106c2678..0fdb7f7174 100644 --- a/src/modules/database/database.cpp +++ b/src/modules/database/database.cpp @@ -202,14 +202,14 @@ static void moveProfileDirProfiles(TCHAR *profiledir, BOOL isRootDir = TRUE) mir_sntprintf(path2, SIZEOF(path2), _T("%s\\%s\\%s"), profiledir, profile, ffd.cFileName);
if (_taccess(path2, 0) == 0) {
TCHAR buf[512];
- mir_sntprintf(buf, SIZEOF(buf),
+ mir_sntprintf(buf,
TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s\nBecause profile with this name already exists. Please resolve the issue manually."),
path, path2);
MessageBox(NULL, buf, _T("Miranda NG"), MB_ICONERROR | MB_OK);
}
else if (MoveFile(path, path2) == 0) {
TCHAR buf[512];
- mir_sntprintf(buf, SIZEOF(buf),
+ mir_sntprintf(buf,
TranslateT("Miranda is trying to upgrade your profile structure.\nIt cannot move profile %s to the new location %s automatically\nMost likely this is due to insufficient privileges. Please move profile manually."),
path, path2);
MessageBox(NULL, buf, _T("Miranda NG"), MB_ICONERROR | MB_OK);
@@ -494,7 +494,7 @@ int LoadDatabaseModule(void) if (arDbPlugins.getCount() == 0) {
TCHAR buf[256];
TCHAR *p = _tcsrchr(szProfile, '\\');
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll"), p ? ++p : szProfile);
+ mir_sntprintf(buf, TranslateT("Miranda is unable to open '%s' because you do not have any profile plugins installed.\nYou need to install dbx_mmap.dll"), p ? ++p : szProfile);
MessageBox(0, buf, TranslateT("No profile support installed!"), MB_OK | MB_ICONERROR);
}
@@ -514,13 +514,13 @@ int LoadDatabaseModule(void) // file isn't locked, just no driver could open it.
TCHAR buf[256];
TCHAR *p = _tcsrchr(szProfile, '\\');
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed."), p ? ++p : szProfile);
+ mir_sntprintf(buf, TranslateT("Miranda was unable to open '%s', it's in an unknown format.\nThis profile might also be damaged, please run DbChecker which should be installed."), p ? ++p : szProfile);
MessageBox(0, buf, TranslateT("Miranda can't understand that profile"), MB_OK | MB_ICONERROR);
}
else if (!FindMirandaForProfile(szProfile)) {
TCHAR buf[256];
TCHAR *p = _tcsrchr(szProfile, '\\');
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance"), p ? ++p : szProfile);
+ mir_sntprintf(buf, TranslateT("Miranda was unable to open '%s'\nIt's inaccessible or used by other application or Miranda instance"), p ? ++p : szProfile);
retry = MessageBox(0, buf, TranslateT("Miranda can't open that profile"), MB_RETRYCANCEL | MB_ICONERROR) == IDRETRY;
}
}
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp index be17cf1416..d972d8cfd2 100644 --- a/src/modules/database/dbini.cpp +++ b/src/modules/database/dbini.cpp @@ -396,7 +396,7 @@ LBL_NewLine: break;
default:
TCHAR buf[250];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Invalid setting type for '%s'. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), _A2T(szName));
+ mir_sntprintf(buf, TranslateT("Invalid setting type for '%s'. The first character of every value must be b, w, d, l, s, e, u, g, h or n."), _A2T(szName));
MessageBox(NULL, buf, TranslateT("Install database settings"), MB_ICONWARNING | MB_OK);
break;
}
diff --git a/src/modules/database/profilemanager.cpp b/src/modules/database/profilemanager.cpp index 742f181d7a..0dc3c75304 100644 --- a/src/modules/database/profilemanager.cpp +++ b/src/modules/database/profilemanager.cpp @@ -55,7 +55,7 @@ static int findProfiles(TCHAR *szProfileDir, ENUMPROFILECALLBACK callback, LPARA // find all subfolders except "." and ".." if ((ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && mir_tstrcmp(ffd.cFileName, _T(".")) && mir_tstrcmp(ffd.cFileName, _T(".."))) { TCHAR buf[MAX_PATH], profile[MAX_PATH]; - mir_sntprintf(buf, SIZEOF(buf), _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); + mir_sntprintf(buf, _T("%s\\%s\\%s.dat"), szProfileDir, ffd.cFileName, ffd.cFileName); if (_taccess(buf, 0) == 0) { mir_sntprintf(profile, SIZEOF(profile), _T("%s.dat"), ffd.cFileName); if (!callback(buf, profile, lParam)) @@ -93,7 +93,7 @@ class CCreateProfileDlg : public CDlgBase if (file) file++; if (_taccess(profile, 0) == 0) { // file already exists! - mir_sntprintf(buf, SIZEOF(buf), + mir_sntprintf(buf, TranslateT("The profile '%s' already exists. Do you want to move it to the Recycle Bin?\n\nWARNING: The profile will be deleted if Recycle Bin is disabled.\nWARNING: A profile may contain confidential information and should be properly deleted."), file); if (MessageBox(m_hwnd, buf, TranslateT("The profile already exists"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) != IDYES) @@ -104,9 +104,9 @@ class CCreateProfileDlg : public CDlgBase sf.wFunc = FO_DELETE; sf.pFrom = buf; sf.fFlags = FOF_NOCONFIRMATION | FOF_NOERRORUI | FOF_SILENT | FOF_ALLOWUNDO; - mir_sntprintf(buf, SIZEOF(buf), _T("%s\0"), profile); + mir_sntprintf(buf, _T("%s\0"), profile); if (SHFileOperation(&sf) != 0) { - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Couldn't move '%s' to the Recycle Bin. Please select another profile name."), file); + mir_sntprintf(buf, TranslateT("Couldn't move '%s' to the Recycle Bin. Please select another profile name."), file); MessageBox(m_hwnd, buf, TranslateT("Problem moving profile"), MB_ICONINFORMATION | MB_OK); return 0; } @@ -115,7 +115,7 @@ class CCreateProfileDlg : public CDlgBase // ask the database to create the profile CreatePathToFileT(profile); if ((err = link->makeDatabase(profile)) != ERROR_SUCCESS) { - mir_sntprintf(buf, SIZEOF(buf), TranslateT("Unable to create the profile '%s', the error was %x"), file, err); + mir_sntprintf(buf, TranslateT("Unable to create the profile '%s', the error was %x"), file, err); MessageBox(m_hwnd, buf, TranslateT("Problem creating profile"), MB_ICONERROR | MB_OK); return 0; } diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp index f1b149740c..9b8db18ff0 100644 --- a/src/modules/findadd/searchresults.cpp +++ b/src/modules/findadd/searchresults.cpp @@ -182,7 +182,7 @@ static void BeginSearchFailed(void * arg) TCHAR buf[128];
if (arg != NULL) {
const TCHAR* protoName = (TCHAR*)arg;
- mir_sntprintf(buf, SIZEOF(buf),
+ mir_sntprintf(buf,
TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
protoName, protoName);
mir_free((char*)arg);
diff --git a/src/modules/metacontacts/meta_addto.cpp b/src/modules/metacontacts/meta_addto.cpp index 4369b3265c..575ecbcb55 100644 --- a/src/modules/metacontacts/meta_addto.cpp +++ b/src/modules/metacontacts/meta_addto.cpp @@ -154,7 +154,7 @@ static INT_PTR CALLBACK Meta_SelectDialogProc(HWND hwndDlg, UINT msg, WPARAM wPa // ... and set it to the Window title.
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Adding %s..."), ptszCDN);
+ mir_sntprintf(buf, TranslateT("Adding %s..."), ptszCDN);
SetWindowText(hwndDlg, buf);
}
ShowWindow(hwndDlg, SW_SHOWNORMAL);
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp index 0c668e50d2..61e3f3775f 100644 --- a/src/modules/options/options.cpp +++ b/src/modules/options/options.cpp @@ -299,9 +299,9 @@ static LRESULT CALLBACK OptionsFilterSubclassProc(HWND hWnd, UINT message, WPARA TCHAR buf[255];
if (bSearchState == 1 && FilterLoadProgress < 100 && FilterLoadProgress > 0)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Loading... %d%%"), FilterLoadProgress);
+ mir_sntprintf(buf, TranslateT("Loading... %d%%"), FilterLoadProgress);
else
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Search"));
+ mir_sntprintf(buf, TranslateT("Search"));
bool bDrawnByTheme = false;
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp index 16f17dfed1..6eccaa8059 100644 --- a/src/modules/plugins/newplugins.cpp +++ b/src/modules/plugins/newplugins.cpp @@ -467,7 +467,7 @@ int isPluginOnWhiteList(const TCHAR* pluginname) int rc = db_get_b(NULL, PLUGINDISABLELIST, _strlwr(_T2A(pluginname)), 0);
if (rc != 0 && askAboutIgnoredPlugins) {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("'%s' is disabled, re-enable?"), pluginname);
+ mir_sntprintf(buf, TranslateT("'%s' is disabled, re-enable?"), pluginname);
if (MessageBox(NULL, buf, TranslateT("Re-enable Miranda plugin?"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
SetPluginOnWhiteList(pluginname, 1);
rc = 0;
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index 1775aad6ac..9200d04bd1 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -61,7 +61,7 @@ static LIST<PluginListItemData> arPluginList(10, sttSortPlugins); static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM lParam)
{
TCHAR buf[MAX_PATH];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s\\Plugins\\%s"), path, fd->cFileName);
+ mir_sntprintf(buf, _T("%s\\Plugins\\%s"), path, fd->cFileName);
HINSTANCE hInst = GetModuleHandle(buf);
BASIC_PLUGIN_INFO pi;
@@ -136,12 +136,12 @@ static BOOL dialogListPlugins(WIN32_FIND_DATA *fd, TCHAR *path, WPARAM, LPARAM l void *pVerInfo = mir_alloc(verInfoSize);
GetFileVersionInfo(buf, 0, verInfoSize, pVerInfo);
VerQueryValue(pVerInfo, _T("\\"), (LPVOID*)&fi, &blockSize);
- mir_sntprintf(buf, SIZEOF(buf), _T("%d.%d.%d.%d"), HIWORD(fi->dwProductVersionMS),
+ mir_sntprintf(buf, _T("%d.%d.%d.%d"), HIWORD(fi->dwProductVersionMS),
LOWORD(fi->dwProductVersionMS), HIWORD(fi->dwProductVersionLS), LOWORD(fi->dwProductVersionLS));
mir_free(pVerInfo);
}
else
- mir_sntprintf(buf, SIZEOF(buf), _T("%d.%d.%d.%d"), HIBYTE(HIWORD(pi.pluginInfo->version)),
+ mir_sntprintf(buf, _T("%d.%d.%d.%d"), HIBYTE(HIWORD(pi.pluginInfo->version)),
LOBYTE(HIWORD(pi.pluginInfo->version)), HIBYTE(LOWORD(pi.pluginInfo->version)),
LOBYTE(LOWORD(pi.pluginInfo->version)));
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index c276a62ca1..35b59d11bb 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -785,7 +785,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM DWORD dwStatus = CallProtoServiceInt(NULL, pa->szModuleName, PS_GETSTATUS, 0, 0);
if (dwStatus >= ID_STATUS_ONLINE) {
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Account %s is being disabled"), pa->tszAccountName);
+ mir_sntprintf(buf, TranslateT("Account %s is being disabled"), pa->tszAccountName);
if (IDNO == ::MessageBox(hwndDlg,
TranslateT("Account is online. Disable account?"),
buf, MB_ICONWARNING | MB_DEFBUTTON2 | MB_YESNO)) {
@@ -845,7 +845,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM if (idx != -1) {
pa = (PROTOACCOUNT*)ListBox_GetItemData(hwndList, idx);
TCHAR buf[200];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Account %s is being deleted"), pa->tszAccountName);
+ mir_sntprintf(buf, TranslateT("Account %s is being deleted"), pa->tszAccountName);
if (pa->bOldProto) {
MessageBox(hwndDlg, TranslateT("You need to disable plugin to delete this account"), buf, MB_ICONERROR | MB_OK);
break;
diff --git a/src/modules/skin/sounds.cpp b/src/modules/skin/sounds.cpp index 1d38355389..1b95f807ed 100644 --- a/src/modules/skin/sounds.cpp +++ b/src/modules/skin/sounds.cpp @@ -385,7 +385,7 @@ INT_PTR CALLBACK DlgProcSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM SendMessage(hwndDlg, DM_HIDEPANE, 0, 0);
else {
TCHAR buf[256];
- mir_sntprintf(buf, SIZEOF(buf), _T("%s: %s"), arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr());
+ mir_sntprintf(buf, _T("%s: %s"), arSounds[tvi.lParam].getSection(), arSounds[tvi.lParam].getDescr());
SetDlgItemText(hwndDlg, IDC_NAMEVAL, buf);
if (arSounds[tvi.lParam].ptszTempFile)
SetDlgItemText(hwndDlg, IDC_LOCATION, arSounds[tvi.lParam].ptszTempFile);
diff --git a/src/modules/utils/enterstring.cpp b/src/modules/utils/enterstring.cpp index 84adf3a1e4..c7fd4b4001 100644 --- a/src/modules/utils/enterstring.cpp +++ b/src/modules/utils/enterstring.cpp @@ -143,7 +143,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (params->timeout > 0) {
SetTimer(hwndDlg, 1001, 1000, NULL);
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), params->timeout);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
}
@@ -162,7 +162,7 @@ static INT_PTR CALLBACK sttEnterStringDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa case 1001:
TCHAR buf[128];
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("OK (%d)"), --params->timeout);
+ mir_sntprintf(buf, TranslateT("OK (%d)"), --params->timeout);
SetDlgItemText(hwndDlg, IDOK, buf);
if (params->timeout < 0) {
|