diff --git a/support/src/utils/file.cpp b/support/src/utils/file.cpp index bd5447d9..40f63710 100644 --- a/support/src/utils/file.cpp +++ b/support/src/utils/file.cpp @@ -213,7 +213,8 @@ auto get_total_drive_space(std::string_view path) try { #if defined(_WIN32) ULARGE_INTEGER li{}; - if (not ::GetDiskFreeSpaceEx(path.c_str(), nullptr, &li, nullptr)) { + if (not ::GetDiskFreeSpaceEx(std::string{path}.c_str(), nullptr, &li, + nullptr)) { throw std::runtime_error("failed to get total disk space|" + std::string{path} + '|' + std::to_string(utils::get_last_error_code()));