From e5debef2008f49ae4655ad419ad656a5aa36438b Mon Sep 17 00:00:00 2001 From: Kasper Laudrup Date: Mon, 26 Feb 2024 12:07:33 +0100 Subject: [PATCH] Silence warning on narrowing conversion GCC warns that int to size_t is a narrowing conversion. Fix that with an explicit cast. --- test/handshake_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/handshake_test.cpp b/test/handshake_test.cpp index 99d03b0c..cbbd1600 100644 --- a/test/handshake_test.cpp +++ b/test/handshake_test.cpp @@ -81,7 +81,7 @@ std::string wchar_to_string(const wchar_t* input) { wintls::detail::throw_last_error("WideCharToMultiByte"); } - std::string output(size_needed, '\0'); + std::string output(static_cast(size_needed), '\0'); const auto size_written = WideCharToMultiByte(CP_UTF8, 0, input, length, &output[0], size_needed, nullptr, nullptr); if (size_written == 0) { wintls::detail::throw_last_error("WideCharToMultiByte");