diff options
author | George Hazan <ghazan@miranda.im> | 2020-02-16 14:35:10 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-02-16 14:35:10 +0300 |
commit | 40686cc1869953a42f311b6d8a3558e99acef37d (patch) | |
tree | 7e6b0d69261ddbfb0aa82535a20eeaf5159103a0 /plugins/TrafficCounter/src | |
parent | 1513340956911f3e3efc252bc1a0bae046dc8d3e (diff) |
useless checks removed
Diffstat (limited to 'plugins/TrafficCounter/src')
-rw-r--r-- | plugins/TrafficCounter/src/statistics.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/TrafficCounter/src/statistics.cpp b/plugins/TrafficCounter/src/statistics.cpp index a0872b769e..b97e34b7b1 100644 --- a/plugins/TrafficCounter/src/statistics.cpp +++ b/plugins/TrafficCounter/src/statistics.cpp @@ -296,13 +296,14 @@ void Stat_ReadFile(PROTOLIST &p) {
LARGE_INTEGER Size;
DWORD BytesRead;
- wchar_t FileName[MAX_PATH], *pszPath;
- SYSTEMTIME stNow;
+ wchar_t FileName[MAX_PATH];
+ {
+ VARSW pszPath(Utils_ReplaceVarsW(L"%miranda_userdata%\\statistics"));
+ CreateDirectoryTreeW(pszPath);
+ mir_snwprintf(FileName, L"%s\\%S.stat", pszPath.get(), p.name);
+ }
- pszPath = Utils_ReplaceVarsW(L"%miranda_userdata%\\statistics");
- CreateDirectoryTreeW(pszPath);
- mir_snwprintf(FileName, L"%s\\%S.stat", pszPath, p.name);
- mir_free(pszPath);
+ SYSTEMTIME stNow;
GetLocalTime(&stNow);
p.hFile = CreateFile(FileName, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ, nullptr, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|