diff options
Diffstat (limited to 'src/path.cpp')
-rw-r--r-- | src/path.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/path.cpp b/src/path.cpp index 2c2deda..3df5918 100644 --- a/src/path.cpp +++ b/src/path.cpp @@ -16,8 +16,11 @@ namespace winapi { namespace { std::wstring do_canonicalize(const std::wstring& path) { + BOOST_STATIC_CONSTEXPR std::size_t init_buffer_size = MAX_PATH; + static_assert(init_buffer_size > 0, "init_buffer_size must be positive"); + std::vector<wchar_t> buffer; - buffer.resize(MAX_PATH); + buffer.resize(init_buffer_size); while (true) { const auto nch = ::GetFullPathNameW(path.c_str(), buffer.size(), buffer.data(), NULL); |