diff --git a/libs/core/prefix/src/find_prefix.cpp b/libs/core/prefix/src/find_prefix.cpp index 6cca5fd6fd23..92374b9a2ebd 100644 --- a/libs/core/prefix/src/find_prefix.cpp +++ b/libs/core/prefix/src/find_prefix.cpp @@ -242,7 +242,7 @@ namespace hpx::util { { std::vector buf(cb); sysctl(mib, 4, &buf[0], &cb, nullptr, 0); - std::copy(&buf[0], &buf[cb], std::back_inserter(r)); + std::copy(buf.begin(), buf.end(), std::back_inserter(r)); } #else