[xboxkrnl] Trim DbgPrint messages.

This commit is contained in:
gibbed 2021-06-28 19:40:25 -05:00 committed by Rick Gibbed
parent a0ed4ec711
commit fb0c354b2f
1 changed files with 8 additions and 1 deletions

View File

@ -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);
}