From 7e315d1103af9248583483da99e96ca339bf2d20 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 11 Apr 2015 15:20:17 +0000 Subject: unsafe string operations replaced with safe wherever possible git-svn-id: http://svn.miranda-ng.org/main/trunk@12768 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/netlib/netliblog.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/modules/netlib/netliblog.cpp') diff --git a/src/modules/netlib/netliblog.cpp b/src/modules/netlib/netliblog.cpp index 9a3aa08ebb..5590d2305c 100644 --- a/src/modules/netlib/netliblog.cpp +++ b/src/modules/netlib/netliblog.cpp @@ -159,7 +159,9 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa case IDC_RUNATSTARTBROWSE: GetWindowText(GetWindow((HWND)lParam, GW_HWNDPREV), str, SIZEOF(str)); { - TCHAR filter[512]; + TCHAR filter[200]; + mir_sntprintf(filter, SIZEOF(filter), _T("%s (*)%c*%c"), TranslateT("All files"), 0, 0); + OPENFILENAME ofn = { 0 }; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = hwndDlg; @@ -170,12 +172,6 @@ static INT_PTR CALLBACK LogOptionsDlgProc(HWND hwndDlg, UINT message, WPARAM wPa ofn.Flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST; ofn.lpstrTitle = TranslateT("Select program to be run"); } - _tcsncpy(filter, TranslateT("All files"), SIZEOF(filter) - 1); - _tcscat(filter, _T(" (*)")); - TCHAR *pfilter = filter + mir_tstrlen(filter) + 1; - _tcscpy(pfilter, _T("*")); - pfilter = pfilter + mir_tstrlen(pfilter) + 1; - *pfilter = '\0'; ofn.lpstrFilter = filter; ofn.lpstrFile = str; ofn.nMaxFile = SIZEOF(str) - 2; -- cgit v1.2.3