From 221a7540da4a15638002eb9d7f8876e3489a6e13 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 22 Dec 2012 19:04:07 +0000 Subject: try to fix crash on parsing data and creating log files git-svn-id: http://svn.miranda-ng.org/main/trunk@2806 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/SeenPlugin/src/file.cpp | 7 ++++++- plugins/SeenPlugin/src/utils.cpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins/SeenPlugin/src') diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp index b6e004897c..357ae08b7b 100644 --- a/plugins/SeenPlugin/src/file.cpp +++ b/plugins/SeenPlugin/src/file.cpp @@ -70,7 +70,12 @@ void FileWrite(HANDLE hcontact) HANDLE fhout = CreateFile(szout, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL); if (fhout == INVALID_HANDLE_VALUE){ - CreateDirectoryTreeT(szout); + TCHAR fullpath[1024]; + _tcscpy(fullpath, szout); + TCHAR *dirpath = _tcsrchr(fullpath, '\\'); + if (dirpath != NULL) + *dirpath = '\0'; + CreateDirectoryTreeT(fullpath); fhout = CreateFile(szout, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, 0, NULL); if (fhout == INVALID_HANDLE_VALUE) return; diff --git a/plugins/SeenPlugin/src/utils.cpp b/plugins/SeenPlugin/src/utils.cpp index c307fe1411..bbbcc66779 100644 --- a/plugins/SeenPlugin/src/utils.cpp +++ b/plugins/SeenPlugin/src/utils.cpp @@ -371,6 +371,7 @@ LBL_charPtr: case 'P': _tcscpy(szdbsetting, ci.szProto ? _A2T(ci.szProto) : (wantempty ? _T("") : _T("ProtoUnknown"))); + charPtr = szdbsetting; goto LBL_charPtr; case 'b': -- cgit v1.2.3