From c370af60855db957c5b200914bf0bde743845528 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 28 Aug 2015 16:22:41 +0000 Subject: mir_sntprintf / mir_snprintf: obsoleted second parameter removed wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@15064 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/BasicHistory/src/EventList.cpp | 4 ++-- plugins/BasicHistory/src/ExportManager.cpp | 2 +- plugins/BasicHistory/src/HistoryWindow.cpp | 2 +- plugins/BasicHistory/src/Options.cpp | 4 ++-- plugins/BasicHistory/src/Scheduler.cpp | 20 ++++++++++---------- 5 files changed, 16 insertions(+), 16 deletions(-) (limited to 'plugins/BasicHistory/src') diff --git a/plugins/BasicHistory/src/EventList.cpp b/plugins/BasicHistory/src/EventList.cpp index 8dd5516bcc..96caf57292 100644 --- a/plugins/BasicHistory/src/EventList.cpp +++ b/plugins/BasicHistory/src/EventList.cpp @@ -346,11 +346,11 @@ void HistoryEventList::InitNames() TCHAR str[200]; if (m_hContact) { _tcscpy_s(m_contactName, pcli->pfnGetContactDisplayName(m_hContact, 0)); - mir_sntprintf(str, _countof(str), TranslateT("History for %s"), m_contactName); + mir_sntprintf(str, TranslateT("History for %s"), m_contactName); } else { _tcscpy_s(m_contactName, TranslateT("System")); - mir_sntprintf(str, _countof(str), TranslateT("History")); + mir_sntprintf(str, TranslateT("History")); } if (m_isWnd) diff --git a/plugins/BasicHistory/src/ExportManager.cpp b/plugins/BasicHistory/src/ExportManager.cpp index 8c05d7bc67..35aa7045e6 100644 --- a/plugins/BasicHistory/src/ExportManager.cpp +++ b/plugins/BasicHistory/src/ExportManager.cpp @@ -41,7 +41,7 @@ std::wstring GetFile(const TCHAR* ext, HWND hwnd, bool open) _tcscpy_s(extUpper, ext); extUpper[0] = std::toupper(ext[0], loc); - mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext); + mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext); size_t len = mir_tstrlen(filter) + 1; mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext); len += mir_tstrlen(filter + len); diff --git a/plugins/BasicHistory/src/HistoryWindow.cpp b/plugins/BasicHistory/src/HistoryWindow.cpp index 247f7cdd5b..a1ad2df7d8 100644 --- a/plugins/BasicHistory/src/HistoryWindow.cpp +++ b/plugins/BasicHistory/src/HistoryWindow.cpp @@ -1949,7 +1949,7 @@ void HistoryWindow::Delete(int what) return; TCHAR message[256]; - mir_sntprintf(message, _countof(message), TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete); + mir_sntprintf(message, TranslateT("Number of history items to delete: %d.\nAre you sure you want to do this?"), toDelete); if (MessageBox(m_hWnd, message, TranslateT("Are You sure?"), MB_OKCANCEL | MB_ICONERROR) != IDOK) return; diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 523cc4bce1..8a795f769e 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -805,7 +805,7 @@ bool OpenFileDlg(HWND hwndDlg, HWND hwndEdit, const TCHAR* defName, const TCHAR* TCHAR extUpper[32]; _tcscpy_s(extUpper, ext); extUpper[0] = std::toupper(ext[0], loc); - mir_sntprintf(filter, _countof(filter), TranslateT("%s Files (*.%s)"), extUpper, ext); + mir_sntprintf(filter, TranslateT("%s Files (*.%s)"), extUpper, ext); size_t len = mir_tstrlen(filter) + 1; mir_sntprintf(filter + len, _countof(filter) - len, _T("*.%s"), ext); len += mir_tstrlen(filter + len) + 1; @@ -1701,7 +1701,7 @@ INT_PTR CALLBACK Options::DlgProcOptsTask(HWND hwndDlg, UINT msg, WPARAM wParam, TCHAR sep = _T(':'); if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, timeFormat, 10) > 0) sep = timeFormat[0]; - mir_sntprintf(timeFormat, _countof(timeFormat), _T("HH%cmm"), sep); + mir_sntprintf(timeFormat, _T("HH%cmm"), sep); } SYSTEMTIME st; diff --git a/plugins/BasicHistory/src/Scheduler.cpp b/plugins/BasicHistory/src/Scheduler.cpp index cd4129a5f5..1dc8a3b79f 100644 --- a/plugins/BasicHistory/src/Scheduler.cpp +++ b/plugins/BasicHistory/src/Scheduler.cpp @@ -236,9 +236,9 @@ bool DoTask(TaskOptions& to) if (err.empty()) _tcscpy_s(msg, TranslateT("Some value is invalid")); else if (errDescr.empty()) - mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value."), err.c_str()); + mir_sntprintf(msg, TranslateT("Invalid '%s' value."), err.c_str()); else - mir_sntprintf(msg, _countof(msg), TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str()); + mir_sntprintf(msg, TranslateT("Invalid '%s' value.\n%s"), err.c_str(), errDescr.c_str()); DoError(to, msg); return true; @@ -395,7 +395,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n"; TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), TranslateT("Incorrect file format: %s."), GetName(*it).c_str()); + mir_sntprintf(msg, TranslateT("Incorrect file format: %s."), GetName(*it).c_str()); errorStr += msg; } else { @@ -404,7 +404,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), TranslateT("Unknown contact in file: %s."), GetName(*it).c_str()); + mir_sntprintf(msg, TranslateT("Unknown contact in file: %s."), GetName(*it).c_str()); errorStr += msg; } } @@ -460,7 +460,7 @@ bool DoTask(TaskOptions& to) TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str()); + mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str()); errorStr += msg; } @@ -481,7 +481,7 @@ bool DoTask(TaskOptions& to) errorStr += L"\n"; TCHAR msg[1024]; - mir_sntprintf(msg, _countof(msg), TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str()); + mir_sntprintf(msg, TranslateT("Cannot export history for contact: %s."), exp->GetContactName().c_str()); errorStr += msg; break; } @@ -586,7 +586,7 @@ std::wstring GetFileName(const std::wstring &baseName, std::wstring contactName, TCHAR time[256]; SYSTEMTIME st; GetLocalTime(&st); - mir_sntprintf(time, _countof(time), _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute); + mir_sntprintf(time, _T("%d-%02d-%02d %02d%02d"), st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute); std::wstring str1 = str.substr(0, pos); str1 += time; str1 += str.substr(pos + 6); @@ -1129,7 +1129,7 @@ bool FtpFiles(const std::wstring& dir, const std::wstring& filePath, const std:: DeleteFile(log.c_str()); TCHAR cmdLine[MAX_PATH]; - mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str()); + mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str()); STARTUPINFO startupInfo = { 0 }; startupInfo.cb = sizeof(STARTUPINFO); @@ -1220,7 +1220,7 @@ bool FtpGetFiles(const std::wstring& dir, const std::list& files, CreateDirectory(GetDirectoryName(log).c_str(), NULL); DeleteFile(log.c_str()); TCHAR cmdLine[MAX_PATH]; - mir_sntprintf(cmdLine, _countof(cmdLine), _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str()); + mir_sntprintf(cmdLine, _T("\"%s\" /nointeractiveinput /log=\"%s\" /script=script.sc"), Options::instance->ftpExePath.c_str(), log.c_str()); STARTUPINFO startupInfo = { 0 }; PROCESS_INFORMATION processInfo; startupInfo.cb = sizeof(STARTUPINFO); @@ -1283,7 +1283,7 @@ INT_PTR ExecuteTaskService(WPARAM wParam, LPARAM) void DoError(const TaskOptions& to, const std::wstring _error) { TCHAR msg[256]; - mir_sntprintf(msg, _countof(msg), TranslateT("Task '%s' execution failed:"), to.taskName.c_str()); + mir_sntprintf(msg, TranslateT("Task '%s' execution failed:"), to.taskName.c_str()); if (Options::instance->schedulerHistoryAlerts) { std::wstring error = msg; error += L"\n"; -- cgit v1.2.3