From 6edbf1f9c6acee516d8f7708cd7c8c873e51fb18 Mon Sep 17 00:00:00 2001 From: dreamforceinc Date: Mon, 28 Feb 2022 19:52:56 +0300 Subject: [PATCH] Changed PATH_LEN constant to internal MAX_PATH. --- wCenterWindow/Logger.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wCenterWindow/Logger.cpp b/wCenterWindow/Logger.cpp index 46b8c50..bbcabeb 100644 --- a/wCenterWindow/Logger.cpp +++ b/wCenterWindow/Logger.cpp @@ -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) {