From 49fb862cd7af5cfa8841be7228da4a459e7805e2 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 10 Jun 2025 21:40:56 +0300 Subject: [PATCH] Fix usage of missing variable --- include/boost/dll/detail/posix/program_location_impl.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/boost/dll/detail/posix/program_location_impl.hpp b/include/boost/dll/detail/posix/program_location_impl.hpp index 8bdb4cd0..88095a48 100644 --- a/include/boost/dll/detail/posix/program_location_impl.hpp +++ b/include/boost/dll/detail/posix/program_location_impl.hpp @@ -70,9 +70,10 @@ namespace boost { namespace dll { namespace detail { mib[2] = KERN_PROC_PATHNAME; mib[3] = -1; char path[1024]; - size_t size = sizeof(buf); - if (sysctl(mib, 4, path, &size, nullptr, 0) == 0) + size_t size = sizeof(path); + if (sysctl(mib, 4, path, &size, nullptr, 0) == 0) { return boost::dll::fs::path(path); + } const auto errno_snapshot = static_cast(errno); if (errno_snapshot != std::errc::not_enough_memory) {