From a7a2b9242132849b4d2e98f9553749e08da77710 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Tue, 19 Sep 2023 21:32:23 +0100 Subject: [PATCH] tcp_client: Fix `SDL_SetError` call Can't pass `std::string_view` for the `%s` placeholder. --- Source/dvlnet/tcp_client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/dvlnet/tcp_client.cpp b/Source/dvlnet/tcp_client.cpp index 5bf460e59..d3a4e12da 100644 --- a/Source/dvlnet/tcp_client.cpp +++ b/Source/dvlnet/tcp_client.cpp @@ -54,7 +54,8 @@ int tcp_client::join(std::string addrstr) = pktfty->make_packet( PLR_BROADCAST, PLR_MASTER, cookie_self, game_init_info); if (!pkt.has_value()) { - SDL_SetError("make_packet: %s", pkt.error().what()); + const std::string_view message = pkt.error().what(); + SDL_SetError("make_packet: %.*s\n", static_cast(message.size()), message.data()); return -1; } send(**pkt);