Changed PATH_LEN constant to internal MAX_PATH.

This commit is contained in:
2022-02-28 19:52:56 +03:00
parent 79acd5d110
commit 6edbf1f9c6

View File

@@ -4,7 +4,6 @@
#include "framework.h" #include "framework.h"
#define TS_LEN 30 #define TS_LEN 30
#define PATH_LEN 1024
std::ofstream logfile; std::ofstream logfile;
extern WCHAR szTitle[]; extern WCHAR szTitle[];
@@ -21,8 +20,8 @@ std::string GetTimeStamp()
void OpenLogFile() void OpenLogFile()
{ {
WCHAR lpszPath[PATH_LEN] = { 0 }; WCHAR lpszPath[MAX_PATH + 1] = { 0 };
DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, PATH_LEN); DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, MAX_PATH);
DWORD dwError = GetLastError(); DWORD dwError = GetLastError();
if (ERROR_INSUFFICIENT_BUFFER == dwError) if (ERROR_INSUFFICIENT_BUFFER == dwError)
{ {