From c49014bbfa57191cd4c52be5d01690a6eef778ac Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 19:04:12 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13650 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Weather/src/weather_ini.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins/Weather/src/weather_ini.cpp') diff --git a/plugins/Weather/src/weather_ini.cpp b/plugins/Weather/src/weather_ini.cpp index 0f81268766..930d2ea828 100644 --- a/plugins/Weather/src/weather_ini.cpp +++ b/plugins/Weather/src/weather_ini.cpp @@ -183,7 +183,7 @@ bool LoadWIData(bool dial) if (chop == NULL) return false; *chop = '\0'; - _tcsncat(szSearchPath, _T("\\Plugins\\Weather\\*.ini"),MAX_PATH - 1); + _tcsncat(szSearchPath, _T("\\Plugins\\Weather\\*.ini"), SIZEOF(szSearchPath) - mir_tstrlen(szSearchPath)); _tcsncpy(FileName, szSearchPath, MAX_PATH - 1); WIN32_FIND_DATA fd; @@ -195,7 +195,7 @@ bool LoadWIData(bool dial) do { chop = _tcsrchr(FileName, '\\'); chop[1] = '\0'; - _tcsncat(FileName, fd.cFileName, SIZEOF(FileName) - 1); + _tcsncat(FileName, fd.cFileName, SIZEOF(FileName) - mir_tstrlen(FileName)); if ( _tcsicmp(fd.cFileName, _T("SAMPLE_INI.INI"))) { WIDATA Data; LoadStationData(FileName, fd.cFileName, &Data); @@ -567,7 +567,7 @@ INT_PTR CALLBACK DlgProcSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar TCHAR *chop = _tcsrchr(szPath, '\\'); if (chop) { *chop = '\0'; - _tcsncat(szPath, _T("\\Plugins\\weather\\"),SIZEOF(szPath) - 1); + _tcsncat(szPath, _T("\\Plugins\\weather\\"), SIZEOF(szPath) - mir_tstrlen(szPath)); _tmkdir(szPath); ShellExecute((HWND)lParam, _T("open"), szPath, _T(""), _T(""), SW_SHOW); } -- cgit v1.2.3