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/Msg_Export/src/FileViewer.cpp | 16 +++++----------- plugins/Msg_Export/src/options.cpp | 2 +- plugins/Msg_Export/src/utils.cpp | 10 +++++----- 3 files changed, 11 insertions(+), 17 deletions(-) (limited to 'plugins/Msg_Export') diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index b68b96a430..c39b00d719 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -191,14 +191,8 @@ int CLStreamRTFInfo::nWriteHeader(char *pszTarget, int nLen) COLORREF cMyText = db_get_dw(NULL, "SRMsg", "Font3Col", RGB(64, 0, 128)); COLORREF cYourText = db_get_dw(NULL, "SRMsg", "Font0Col", RGB(240, 0, 0)); - /* original header !! - "{\\rtf1\\ansi\\deff0{\\fonttbl{\\f0\\fnil\\fcharset0 Courier New;}}\r\n" - "{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n" - "\\viewkind4\\uc1\\pard\\cf2\\lang1033\\f0\\fs16 ", - - */ char szRtfHeader[400]; - int nSrcLen = mir_snprintf(szRtfHeader, _countof(szRtfHeader), + int nSrcLen = mir_snprintf(szRtfHeader, "{\\rtf1\\ansi\r\n" "{\\colortbl ;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}\r\n" "\\viewkind4\\uc1\\pard\\cf2 ", @@ -625,9 +619,9 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) TCHAR szTmp[1500]; if (nDBCount == -1) - mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str()); + mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nContact handle is invalid"), pclDlg->sPath.c_str()); else - mir_sntprintf(szTmp, _countof(szTmp), TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount); + mir_sntprintf(szTmp, TranslateT("Failed to open file\r\n%s\r\n\r\nMiranda database contains %d events"), pclDlg->sPath.c_str(), nDBCount); SETTEXTEX stText = { 0 }; stText.codepage = 1200; @@ -674,7 +668,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) CloseHandle(hFile); TCHAR szTmp[100]; - mir_sntprintf(szTmp, _countof(szTmp), _T("File open time %d\n"), GetTickCount() - dwStart); + mir_sntprintf(szTmp, _T("File open time %d\n"), GetTickCount() - dwStart); OutputDebugString(szTmp); GETTEXTLENGTHEX sData = { 0 }; @@ -686,7 +680,7 @@ bool bLoadFile(HWND hwndDlg, CLHistoryDlg * pclDlg) if (!bScrollToBottom) SendMessage(hRichEdit, EM_SETSCROLLPOS, 0, (LPARAM)&ptOldPos); - mir_sntprintf(szTmp, _countof(szTmp), TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart); + mir_sntprintf(szTmp, TranslateT("With scroll to bottom %d\n"), GetTickCount() - dwStart); OutputDebugString(szTmp); return true; } diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 3a46bc8617..6611f692da 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -706,7 +706,7 @@ static INT_PTR CALLBACK DlgProcMsgExportOpts(HWND hwndDlg, UINT msg, WPARAM wPar DWORD dwUIN = db_get_dw(hContact, sTmpA.c_str(), "UIN", 0); TCHAR szTmp[50]; - mir_sntprintf(szTmp, _countof(szTmp), _T("%d"), dwUIN); + mir_sntprintf(szTmp, _T("%d"), dwUIN); sItem.iSubItem = 3; sItem.pszText = szTmp; ListView_SetItem(hMapUser, &sItem); diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index f078536f62..2cc790b844 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -464,7 +464,7 @@ bool bWriteHexToFile(HANDLE hFile, void * pData, int nSize) char cBuf[10]; BYTE *p = (BYTE*)pData; for (int n = 0; n < nSize; n++) { - mir_snprintf(cBuf, _countof(cBuf), "%.2X ", p[n]); + mir_snprintf(cBuf, "%.2X ", p[n]); if (!bWriteToFile(hFile, cBuf, 3)) return false; } @@ -702,7 +702,7 @@ void ReplaceDefines(MCONTACT hContact, tstring & sTarget) tstring sReplaceUin; if (dwUIN) { TCHAR sTmp[20]; - mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), dwUIN); + mir_sntprintf(sTmp, _T("%d"), dwUIN); sReplaceUin = sTmp; } else sReplaceUin = FileNickFromHandle(hContact); @@ -784,11 +784,11 @@ void ReplaceTimeVariables(tstring &sRet) GetLocalTime(&stTime); TCHAR sTmp[20]; - mir_sntprintf(sTmp, _countof(sTmp), _T("%d"), stTime.wYear); + mir_sntprintf(sTmp, _T("%d"), stTime.wYear); ReplaceAll(sRet, _T("%year%"), sTmp); - mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wMonth); + mir_sntprintf(sTmp, _T("%.2d"), stTime.wMonth); ReplaceAll(sRet, _T("%month%"), sTmp); - mir_sntprintf(sTmp, _countof(sTmp), _T("%.2d"), stTime.wDay); + mir_sntprintf(sTmp, _T("%.2d"), stTime.wDay); ReplaceAll(sRet, _T("%day%"), sTmp); } } -- cgit v1.2.3