diff --git a/tests/test_util/executable_path.cpp b/tests/test_util/executable_path.cpp index 082f5414..365f7367 100644 --- a/tests/test_util/executable_path.cpp +++ b/tests/test_util/executable_path.cpp @@ -65,8 +65,8 @@ namespace test_util { std::string get_executable_path() { std::array buffer{}; const ssize_t size = ::readlink("/proc/self/exe", buffer.data(), buffer.size()); - if (size != -1) { - return {buffer.data(), size}; + if (size >= 1) { + return {buffer.data(), size_t(size)}; } throw std::system_error(std::make_error_code(std::errc::no_such_file_or_directory), "Could not get executable path");