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"
#define TS_LEN 30
#define PATH_LEN 1024
std::ofstream logfile;
extern WCHAR szTitle[];
@@ -21,8 +20,8 @@ std::string GetTimeStamp()
void OpenLogFile()
{
WCHAR lpszPath[PATH_LEN] = { 0 };
DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, PATH_LEN);
WCHAR lpszPath[MAX_PATH + 1] = { 0 };
DWORD dwPathLength = GetModuleFileNameW(NULL, lpszPath, MAX_PATH);
DWORD dwError = GetLastError();
if (ERROR_INSUFFICIENT_BUFFER == dwError)
{