From 5b2ebe7fef3a15c5db381816241bf16850c8176a Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 18:09:55 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13634 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/IndexHTML.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/HTTPServer/src/IndexHTML.cpp') diff --git a/plugins/HTTPServer/src/IndexHTML.cpp b/plugins/HTTPServer/src/IndexHTML.cpp index 89fc56f157..fed678827d 100644 --- a/plugins/HTTPServer/src/IndexHTML.cpp +++ b/plugins/HTTPServer/src/IndexHTML.cpp @@ -63,7 +63,7 @@ bool LoadIndexHTMLTemplate() { char* pszDestBuf = szDestBuf; strncpy(pszBuf, szPluginPath, SIZEOF(szBuf)-1); - strncat(pszBuf, szIndexHTMLTemplateFile, SIZEOF(szBuf)-1); + strncat(pszBuf, szIndexHTMLTemplateFile, SIZEOF(szBuf) - mir_strlen(szBuf)); HANDLE hFile = CreateFile(pszBuf, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); @@ -284,7 +284,7 @@ bool bCreateIndexHTML(const char * pszRealPath, const char * pszIndexPath, // check if directory exists char szMask[MAX_PATH]; strncpy(szMask, pszRealPath, MAX_PATH- 1); - strncat(szMask, "*", MAX_PATH- 1); + strncat(szMask, "*", SIZEOF(szMask) - mir_strlen(szMask)); WIN32_FIND_DATAA fdFindFileData; HANDLE hFind = FindFirstFile(szMask, &fdFindFileData); -- cgit v1.2.3