From c3e735f9dcd73f1d9cbf502f2e04c1a4ecf9f0cd Mon Sep 17 00:00:00 2001 From: Mataes Date: Sat, 31 Mar 2018 20:01:27 +0300 Subject: Msg_Export: mir_strcpy and mir_wstrcpy replaced to strncpy_s and wcsncpy_s --- plugins/Msg_Export/src/FileViewer.cpp | 4 ++-- plugins/Msg_Export/src/options.cpp | 2 +- plugins/Msg_Export/src/utils.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/Msg_Export') diff --git a/plugins/Msg_Export/src/FileViewer.cpp b/plugins/Msg_Export/src/FileViewer.cpp index 434e1b025a..be585c029b 100755 --- a/plugins/Msg_Export/src/FileViewer.cpp +++ b/plugins/Msg_Export/src/FileViewer.cpp @@ -908,7 +908,7 @@ void SetRichEditFont(HWND hRichEdit, bool bUseSyntaxHL) ncf.dwMask = CFM_BOLD | CFM_FACE | CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE; ncf.dwEffects = db_get_dw(NULL, MODULE, szFileViewDB "TEffects", 0); ncf.yHeight = db_get_dw(NULL, MODULE, szFileViewDB "THeight", 165); - mir_wstrcpy(ncf.szFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str()); + wcsncpy_s(ncf.szFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE); if (!bUseSyntaxHL) { ncf.dwMask |= CFM_COLOR; @@ -1036,7 +1036,7 @@ static INT_PTR CALLBACK DlgProcFileViewer(HWND hwndDlg, UINT msg, WPARAM wParam, lf.lfStrikeOut = (dwEffects & CFE_STRIKEOUT) != 0; lf.lfItalic = (dwEffects & CFE_ITALIC) != 0; - mir_wstrcpy(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str()); + wcsncpy_s(lf.lfFaceName, _DBGetString(NULL, MODULE, szFileViewDB "TFace", L"Courier New").c_str(), _TRUNCATE); CHOOSEFONT cf = { 0 }; cf.lStructSize = sizeof(cf); cf.hwndOwner = hwndDlg; diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 7765d1cc95..7dff1cf799 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1043,7 +1043,7 @@ BOOL bApplyChanges2(HWND hwndDlg) enDeleteAction = eDANothing; char szTemp[500]; - mir_strcpy(szTemp, "DisableProt_"); + strncpy_s(szTemp, "DisableProt_", _TRUNCATE); HWND hMapUser = GetDlgItem(hwndDlg, IDC_EXPORT_PROTOS); int nCount = ListView_GetItemCount(hMapUser); diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 7dc168b153..b7baa46071 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) bool bReadMirandaDirAndPath() { wchar_t szDBPath[MAX_PATH], tmp[MAX_PATH]; - mir_wstrcpy(szDBPath, pszDbPathError); + wcsncpy_s(szDBPath, pszDbPathError, _TRUNCATE); PathToAbsoluteW(L"miranda32.exe", tmp); sMirandaPath = tmp; sMirandaPath.erase(sMirandaPath.find_last_of(L"\\")); @@ -821,7 +821,7 @@ void DisplayErrorDialog(const wchar_t *pszError, tstring& sFilePath, DBEVENTINFO if (MessageBox(nullptr, sError.c_str(), MSG_BOX_TITEL, MB_YESNO) == IDYES) { OPENFILENAME ofn; // common dialog box structure wchar_t szFile[260]; // buffer for file name - mir_wstrcpy(szFile, L"DebugInfo.txt"); + wcsncpy_s(szFile, L"DebugInfo.txt", _TRUNCATE); // Initialize OPENFILENAME memset(&ofn, 0, sizeof(OPENFILENAME)); -- cgit v1.2.3