From fc51a6fd0817f4f85f1210834b1f2d4ec6cc3ec9 Mon Sep 17 00:00:00 2001 From: fearlessTobi Date: Sun, 18 Nov 2018 00:51:14 +0100 Subject: [PATCH] Fix functions which used Common::ArrayToString --- src/core/hle/service/ir/extra_hid.cpp | 17 ++++++++++++----- src/core/movie.cpp | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/core/hle/service/ir/extra_hid.cpp b/src/core/hle/service/ir/extra_hid.cpp index 31b63257e5..2a00ac08f8 100644 --- a/src/core/hle/service/ir/extra_hid.cpp +++ b/src/core/hle/service/ir/extra_hid.cpp @@ -165,8 +165,10 @@ void ExtraHID::OnDisconnect() { void ExtraHID::HandleConfigureHIDPollingRequest(const std::vector& request) { if (request.size() != 3) { - LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), - Common::ArrayToString(request.data(), request.size())); + std::string request_string; + for (auto request_part : request) + request_string += fmt::format("{:02x} ", request_part); + LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request.size(), request_string); return; } @@ -188,8 +190,11 @@ void ExtraHID::HandleReadCalibrationDataRequest(const std::vector& request_b "ReadCalibrationDataRequest has wrong size"); if (request_buf.size() != sizeof(ReadCalibrationDataRequest)) { + std::string request_buf_string; + for (auto request_buf_part : request_buf) + request_buf_string += fmt::format("{:02x} ", request_buf_part); LOG_ERROR(Service_IR, "Wrong request size ({}): {}", request_buf.size(), - Common::ArrayToString(request_buf.data(), request_buf.size())); + request_buf_string); return; } @@ -223,8 +228,10 @@ void ExtraHID::OnReceive(const std::vector& data) { HandleReadCalibrationDataRequest(data); break; default: - LOG_ERROR(Service_IR, "Unknown request: {}", - Common::ArrayToString(data.data(), data.size())); + std::string data_string; + for (auto data_part : data) + data_string += fmt::format("{:02x} ", data_part); + LOG_ERROR(Service_IR, "Unknown request: {}", data_string); break; } } diff --git a/src/core/movie.cpp b/src/core/movie.cpp index a0f237cf3d..1374349f68 100644 --- a/src/core/movie.cpp +++ b/src/core/movie.cpp @@ -358,9 +358,9 @@ Movie::ValidationResult Movie::ValidateHeader(const CTMHeader& header, u64 progr return ValidationResult::Invalid; } - std::string revision = - Common::ArrayToString(header.revision.data(), header.revision.size(), 21, false); - revision = Common::ToLower(revision); + std::string revision; + for (auto header_part : header.revision) + revision += fmt::format("{:02x}", header_part); if (!program_id) Core::System::GetInstance().GetAppLoader().ReadProgramId(program_id);