Browse Source

tcp_client: Fix `SDL_SetError` call

Can't pass `std::string_view` for the `%s` placeholder.
pull/6639/head
Gleb Mazovetskiy 3 years ago
parent
commit
a7a2b92421
  1. 3
      Source/dvlnet/tcp_client.cpp

3
Source/dvlnet/tcp_client.cpp

@ -54,7 +54,8 @@ int tcp_client::join(std::string addrstr)
= pktfty->make_packet<PT_JOIN_REQUEST>(
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<int>(message.size()), message.data());
return -1;
}
send(**pkt);

Loading…
Cancel
Save