From 6a20550a83b0397696cbcecea73aa450d1385d75 Mon Sep 17 00:00:00 2001 From: Alberto Sartori Date: Thu, 23 Mar 2023 10:49:03 +0100 Subject: curl_easy_handle: fix unused return value... ...depending on the compiler and/or c++lib version, std::fread may warn about unused return value triggering a compile error, due to our compile flags. --- src/other_tools/utils/curl_easy_handle.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/other_tools/utils/curl_easy_handle.cpp') diff --git a/src/other_tools/utils/curl_easy_handle.cpp b/src/other_tools/utils/curl_easy_handle.cpp index 837a9ad0..17ba0261 100644 --- a/src/other_tools/utils/curl_easy_handle.cpp +++ b/src/other_tools/utils/curl_easy_handle.cpp @@ -41,7 +41,14 @@ auto read_stream_data(gsl::not_null const& stream) noexcept std::string content(static_cast(size), '\0'); // read stream content into string buffer - std::fread(content.data(), 1, content.size(), stream); + auto n = std::fread(content.data(), 1, content.size(), stream); + if (n != static_cast(size)) { + Logger::Log(LogLevel::Warning, + "Reading curl log from temporary file failed: read only {} " + "bytes while {} were expected", + n, + size); + } return content; } -- cgit v1.2.3