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.
This commit is contained in:
parent
715a551dac
commit
04822d5a2c
|
@ -9,6 +9,8 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include "Common/ChunkFile.h"
|
||||
#include "Common/EnumUtils.h"
|
||||
#include "Common/Logging/Log.h"
|
||||
|
@ -218,11 +220,12 @@ IPCReply ESDevice::GetTitleDirectory(const IOCtlVRequest& request)
|
|||
auto& memory = system.GetMemory();
|
||||
|
||||
const u64 title_id = memory.Read_U64(request.in_vectors[0].address);
|
||||
|
||||
char* path = reinterpret_cast<char*>(memory.GetPointer(request.io_vectors[0].address));
|
||||
sprintf(path, "/title/%08x/%08x/data", static_cast<u32>(title_id >> 32),
|
||||
const auto path = fmt::format("/title/{:08x}/{:08x}/data", static_cast<u32>(title_id >> 32),
|
||||
static_cast<u32>(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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue