Core/NetPlayServer: Use fmt::format_to_n in GetInterfaceHost()

Lets us avoid some noisy deprecation warnings on macOS (and also lets us use
a more generic formatting specifier).
This commit is contained in:
Lioncache 2023-12-18 10:16:10 -05:00
parent 2b877fc92b
commit 9abcc1c08b
1 changed files with 3 additions and 2 deletions

View File

@ -2294,8 +2294,9 @@ std::unordered_set<std::string> NetPlayServer::GetInterfaceSet() const
// called from ---GUI--- thread
std::string NetPlayServer::GetInterfaceHost(const std::string& inter) const
{
char buf[16];
sprintf(buf, ":%d", GetPort());
char buf[16]{};
fmt::format_to_n(buf, sizeof(buf) - 1, ":{}", GetPort());
auto lst = GetInterfaceListInternal();
for (const auto& list_entry : lst)
{