From efd438ad7b533ba2adb4f22a1cb358ee449db825 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 4 Jun 2015 22:23:03 +0000 Subject: new mir_sntprintf templates without SIZEOF git-svn-id: http://svn.miranda-ng.org/main/trunk@14004 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Msg_Export/src/FileViewer.cpp | 2 +- plugins/Msg_Export/src/options.cpp | 4 ++-- plugins/Msg_Export/src/utils.cpp | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) (limited to 'plugins/Msg_Export/src') 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()); -- cgit v1.2.3