From 6e2b6b31bae6d69bff5271451e73eb08637b8118 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Tue, 2 Dec 2014 03:47:27 +0000 Subject: mir_sntprintf(..., _T("%s"), ...) -> _tcsncpy_s(..., ..., _TRUNCATE) fix some x64 ptr truncations git-svn-id: http://svn.miranda-ng.org/main/trunk@11211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/chat/options.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/TabSRMM/src/chat/options.cpp') diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp index dc89da275f..d4fb1228dc 100644 --- a/plugins/TabSRMM/src/chat/options.cpp +++ b/plugins/TabSRMM/src/chat/options.cpp @@ -831,7 +831,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM case IDC_MUC_OPENLOGBASEDIR: { TCHAR tszTemp[MAX_PATH + 20]; - mir_sntprintf(tszTemp, MAX_PATH + 20, _T("%s"), g_Settings.pszLogDir); + _tcsncpy_s(tszTemp, g_Settings.pszLogDir, _TRUNCATE); TCHAR *p = tszTemp; while(*p && (*p == '\\' || *p == '.')) @@ -841,10 +841,10 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM if (TCHAR *p1 = _tcschr(p, '\\')) *p1 = 0; - TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10]; - mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M.getChatLogPath(), p); + TCHAR tszInitialDir[_MAX_DRIVE + _MAX_PATH + 10]; + mir_sntprintf(tszInitialDir, SIZEOF(tszInitialDir), _T("%s%s"), M.getChatLogPath(), p); if (!PathFileExists(tszInitialDir)) - mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M.getChatLogPath()); + _tcsncpy_s(tszInitialDir, M.getChatLogPath(), _TRUNCATE); TCHAR tszReturnName[MAX_PATH]; tszReturnName[0] = 0; mir_sntprintf(tszTemp, SIZEOF(tszTemp), _T("%s%c*.*%c%c"), TranslateT("All Files"), 0, 0, 0); -- cgit v1.2.3