From 04822d5a2c870e0e8441fb0e40d4851da63ffa29 Mon Sep 17 00:00:00 2001 From: Lioncache Date: Mon, 18 Dec 2023 10:05:48 -0500 Subject: [PATCH] Core/IOS/ES: Make use of fmt::format where applicable Eliminates a deprecation warnings on macOS. While we're in the same area, we can remove the call to GetPointer() and instead use CopyToEmu() to copy the string data back to the emulated memory. --- Source/Core/Core/IOS/ES/ES.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/IOS/ES/ES.cpp b/Source/Core/Core/IOS/ES/ES.cpp index ec8a5aa5ab..41e15e613b 100644 --- a/Source/Core/Core/IOS/ES/ES.cpp +++ b/Source/Core/Core/IOS/ES/ES.cpp @@ -9,6 +9,8 @@ #include #include +#include + #include "Common/ChunkFile.h" #include "Common/EnumUtils.h" #include "Common/Logging/Log.h" @@ -218,10 +220,11 @@ IPCReply ESDevice::GetTitleDirectory(const IOCtlVRequest& request) auto& memory = system.GetMemory(); const u64 title_id = memory.Read_U64(request.in_vectors[0].address); + const auto path = fmt::format("/title/{:08x}/{:08x}/data", static_cast(title_id >> 32), + static_cast(title_id)); - char* path = reinterpret_cast(memory.GetPointer(request.io_vectors[0].address)); - sprintf(path, "/title/%08x/%08x/data", static_cast(title_id >> 32), - static_cast(title_id)); + const auto path_dst = request.io_vectors[0].address; + memory.CopyToEmu(path_dst, path.data(), path.size()); INFO_LOG_FMT(IOS_ES, "IOCTL_ES_GETTITLEDIR: {}", path); return IPCReply(IPC_SUCCESS);