Skip to content

Commit d662bcb

Browse files
authored
Fix usage of missing variable (#98)
Fixes #96
1 parent fac620f commit d662bcb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

include/boost/dll/detail/posix/program_location_impl.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ namespace boost { namespace dll { namespace detail {
7070
mib[2] = KERN_PROC_PATHNAME;
7171
mib[3] = -1;
7272
char path[1024];
73-
size_t size = sizeof(buf);
74-
if (sysctl(mib, 4, path, &size, nullptr, 0) == 0)
73+
size_t size = sizeof(path);
74+
if (sysctl(mib, 4, path, &size, nullptr, 0) == 0) {
7575
return boost::dll::fs::path(path);
76+
}
7677

7778
const auto errno_snapshot = static_cast<std::errc>(errno);
7879
if (errno_snapshot != std::errc::not_enough_memory) {

0 commit comments

Comments
 (0)