Skip to content

Commit 03d01dc

Browse files
committed
Fix crash in get_executable_filename on FreeBSD
The std::vector object needs to have the element allocated in order to take its address.
1 parent 3521f71 commit 03d01dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/core/prefix/src/find_prefix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ namespace hpx::util {
242242
{
243243
std::vector<char> buf(cb);
244244
sysctl(mib, 4, &buf[0], &cb, nullptr, 0);
245-
std::copy(&buf[0], &buf[cb], std::back_inserter(r));
245+
std::copy(buf.begin(), buf.end(), std::back_inserter(r));
246246
}
247247

248248
#else

0 commit comments

Comments
 (0)