summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-02-04 20:13:44 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-02-04 20:13:44 +0300
commit2cea992a66689b940daaab17259a053af7d229e1 (patch)
tree88f58f879e7aa0dcd1d4a523ba3aa49c9a5eaee0 /plugins
parent93cf1109fd0b299d8eb8aab2d1f04b88b9f2ffcf (diff)
code cleaning
Diffstat (limited to 'plugins')
-rw-r--r--plugins/SeenPlugin/src/file.cpp20
1 files changed, 6 insertions, 14 deletions
diff --git a/plugins/SeenPlugin/src/file.cpp b/plugins/SeenPlugin/src/file.cpp
index 5c61ce52a5..a8dd0c4345 100644
--- a/plugins/SeenPlugin/src/file.cpp
+++ b/plugins/SeenPlugin/src/file.cpp
@@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "stdafx.h"
bool g_bFileActive;
-static wchar_t *g_ptszFileStamp, *g_ptszFileName;
+static CMStringW g_ptszFileStamp, g_ptszFileName;
/////////////////////////////////////////////////////////////////////////////////////////
// Prepares the log file:
@@ -30,24 +30,16 @@ static wchar_t *g_ptszFileStamp, *g_ptszFileName;
void InitFileOutput(void)
{
- ptrW tszFileName(g_plugin.getWStringA("FileName"));
- if (tszFileName == NULL)
- tszFileName = mir_wstrdup(DEFAULT_FILENAME);
- replaceStrW(g_ptszFileName, VARSW(tszFileName));
-
- wchar_t *tszPath = NEWWSTR_ALLOCA(g_ptszFileName);
- wchar_t *p = wcsrchr(tszPath, '\\');
- if (p) *p = 0;
- CreateDirectoryTreeW(tszPath);
+ g_ptszFileName = VARSW(g_plugin.getMStringW("FileName", DEFAULT_FILENAME));
+ CreatePathToFileW(g_ptszFileName);
- ptrW tszFileStamp(g_plugin.getWStringA("FileStamp"));
- replaceStrW(g_ptszFileStamp, (tszFileStamp == NULL) ? DEFAULT_FILESTAMP : tszFileStamp);
+ g_ptszFileStamp = g_plugin.getMStringW("FileStamp", DEFAULT_FILESTAMP);
}
void UninitFileOutput()
{
- mir_free(g_ptszFileName);
- mir_free(g_ptszFileStamp);
+ g_ptszFileName.Empty();
+ g_ptszFileStamp.Empty();
}
/////////////////////////////////////////////////////////////////////////////////////////