From fb0c354b2fcecbc7901416b2a1bb6025f1084a5c Mon Sep 17 00:00:00 2001 From: gibbed Date: Mon, 28 Jun 2021 19:40:25 -0500 Subject: [PATCH] [xboxkrnl] Trim DbgPrint messages. --- src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc index ff56a8889..f350fd9e5 100644 --- a/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc +++ b/src/xenia/kernel/xboxkrnl/xboxkrnl_strings.cc @@ -833,7 +833,14 @@ SHIM_CALL DbgPrint_shim(PPCContext* ppc_context, KernelState* kernel_state) { return; } - XELOGI("(DbgPrint) {}", data.str()); + // trim whitespace from end of message + auto str = data.str(); + str.erase(std::find_if(str.rbegin(), str.rend(), + [](uint8_t c) { return !std::isspace(c); }) + .base(), + str.end()); + + XELOGI("(DbgPrint) {}", str); SHIM_SET_RETURN_32(X_STATUS_SUCCESS); }