summaryrefslogtreecommitdiff
path: root/plugins/FileAsMessage
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 08:01:55 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-13 08:01:55 +0000
commit303e6b483aff4126701ca375dd085e9ae1d18b43 (patch)
tree148d820728544a5fd6f6e87fdffbc5b80424c457 /plugins/FileAsMessage
parentcce79a92d5341111997eaf7fd0a420fdddc3e50d (diff)
multiple buf size fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11361 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FileAsMessage')
-rw-r--r--plugins/FileAsMessage/src/dialog.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/plugins/FileAsMessage/src/dialog.cpp b/plugins/FileAsMessage/src/dialog.cpp
index 9cc63c3929..2b144d6048 100644
--- a/plugins/FileAsMessage/src/dialog.cpp
+++ b/plugins/FileAsMessage/src/dialog.cpp
@@ -884,16 +884,19 @@ int FILEECHO::sendCmd(int id, int cmd, char *szParam, char *szPrefix)
void CreateDirectoryTree(char *szDir)
{
DWORD dwAttributes;
- char *pszLastBackslash,szTestDir[MAX_PATH];
-
- mir_tstrncpy(szTestDir,szDir,sizeof(szTestDir));
- if((dwAttributes=GetFileAttributes(szTestDir))!=0xffffffff
- && dwAttributes&FILE_ATTRIBUTE_DIRECTORY) return;
- pszLastBackslash=strrchr(szTestDir,'\\');
- if(pszLastBackslash==NULL) {GetCurrentDirectory(MAX_PATH,szDir); return;}
- *pszLastBackslash='\0';
+ char *pszLastBackslash, szTestDir[MAX_PATH];
+
+ strncpy_s(szTestDir, szDir, _TRUNCATE);
+ if((dwAttributes = GetFileAttributes(szTestDir)) != 0xffffffff && (dwAttributes & FILE_ATTRIBUTE_DIRECTORY))
+ return;
+ pszLastBackslash = strrchr(szTestDir, '\\');
+ if (pszLastBackslash == NULL) {
+ GetCurrentDirectory(MAX_PATH, szDir);
+ return;
+ }
+ *pszLastBackslash = 0;
CreateDirectoryTree(szTestDir);
- CreateDirectory(szTestDir,NULL);
+ CreateDirectory(szTestDir, NULL);
}
LRESULT CALLBACK ProgressWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)