Replace an instance of MAX_PATH with 32767

... which is the approximate maximum of Windows API, as documented in
https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation

Change-Id: I152b0b499374167720d73a475f2502e52fc5a5dc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163910
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2024-02-25 19:15:13 +06:00
parent 3fef8ba992
commit fa86d95014

View file

@ -31,8 +31,8 @@ const OUString& GetSofficeExe()
{
static const OUString s_sPath = []() {
OUString result;
wchar_t sPath[MAX_PATH];
if (GetModuleFileNameW(nullptr, sPath, MAX_PATH) == 0)
wchar_t sPath[32767];
if (GetModuleFileNameW(nullptr, sPath, std::size(sPath)) == 0)
return result;
wchar_t* pSlashPos = wcsrchr(sPath, L'\\');
if (pSlashPos == nullptr)