From 20d319ca66b1765ab7db9ff4905e294017ce7151 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 16 May 2015 18:03:29 +0000 Subject: fix for strncat use git-svn-id: http://svn.miranda-ng.org/main/trunk@13632 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ExternalAPI/m_folders.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/ExternalAPI') diff --git a/plugins/ExternalAPI/m_folders.h b/plugins/ExternalAPI/m_folders.h index 4f896eec6d..f6f00445e6 100644 --- a/plugins/ExternalAPI/m_folders.h +++ b/plugins/ExternalAPI/m_folders.h @@ -209,10 +209,10 @@ __inline static INT_PTR FoldersGetCustomPathEx(HANDLE hFolderEntry, char *path, } if (path[0] != '\0') - strncat(path, "\\", size); + strncat(path, "\\", size - mir_strlen(path)); if (fileName) - strncat(path, fileName, size); + strncat(path, fileName, size - mir_strlen(path)); return res; } @@ -232,10 +232,10 @@ __inline static INT_PTR FoldersGetCustomPathExW(HANDLE hFolderEntry, wchar_t *pa } if (pathW[0] != '\0') - wcsncat(pathW, L"\\", size); + wcsncat(pathW, L"\\", size - mir_wstrlen(pathW)); if (fileNameW) - wcsncat(pathW, fileNameW, size); + wcsncat(pathW, fileNameW, size - mir_wstrlen(pathW)); return res; } -- cgit v1.2.3