diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-24 16:52:21 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-02-25 07:29:40 +0100 |
commit | 3234c4e35fe97cffb87f785614b3b593e2237310 (patch) | |
tree | 5bfc988337d90dc895cd56c7b88fffaa70d6747e /desktop/win32/source/unoinfo.cxx | |
parent | f894670c2cb654a1e21fb34f440977af74e8a560 (diff) |
Avoid MAX_PATH limitation in launcher
... and drop some manual memory management.
Change-Id: I4c60ce559ff185d4685a6b9799a97651438115b1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162502
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'desktop/win32/source/unoinfo.cxx')
-rw-r--r-- | desktop/win32/source/unoinfo.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/desktop/win32/source/unoinfo.cxx b/desktop/win32/source/unoinfo.cxx index 14cee8819dde..28a91b41547d 100644 --- a/desktop/win32/source/unoinfo.cxx +++ b/desktop/win32/source/unoinfo.cxx @@ -50,14 +50,11 @@ void writePath( wchar_t const * frontBegin, wchar_t const * frontEnd, wchar_t const * backBegin, std::size_t backLength) { - wchar_t path[MAX_PATH]; - wchar_t * end = tools::buildPath( - path, frontBegin, frontEnd, backBegin, backLength); - if (end == nullptr) { + std::wstring path = tools::buildPath({ frontBegin, frontEnd }, { backBegin, backLength }); + if (path.empty()) { exit(EXIT_FAILURE); } - std::size_t n = (end - path) * sizeof (wchar_t); - if (fwrite(path, 1, n, stdout) != n) { + if (fwrite(path.data(), sizeof (wchar_t), path.size(), stdout) != path.size()) { exit(EXIT_FAILURE); } } |