summaryrefslogtreecommitdiff
path: root/src/modules/netlib/netliblog.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-04-11 15:20:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-04-11 15:20:17 +0000
commit7e315d1103af9248583483da99e96ca339bf2d20 (patch)
tree6398336a2286278e6857e3205247ba0ed74a2e20 /src/modules/netlib/netliblog.cpp
parentc391c203e82d635e58561911ac7753c1d1261cc9 (diff)
unsafe string operations replaced with safe wherever possible
git-svn-id: http://svn.miranda-ng.org/main/trunk@12768 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/netlib/netliblog.cpp')
-rw-r--r--src/modules/netlib/netliblog.cpp10
1 files changed, 3 insertions, 7 deletions
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;