From 9abcc1c08b6f51a7dead69523dfc86ba115d8f86 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Mon, 18 Dec 2023 10:16:10 -0500 Subject: [PATCH] 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). --- Source/Core/Core/NetPlayServer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/NetPlayServer.cpp b/Source/Core/Core/NetPlayServer.cpp index a939a15681..0705e4d2a7 100644 --- a/Source/Core/Core/NetPlayServer.cpp +++ b/Source/Core/Core/NetPlayServer.cpp @@ -2294,8 +2294,9 @@ std::unordered_set 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) {