From adbd8d005c24766fcbd9fcd16854ae57d2888644 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 11 Feb 2018 11:10:02 -0800 Subject: [PATCH] Cheats: Fix a debug assertion. --- Core/CwCheat.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Core/CwCheat.cpp b/Core/CwCheat.cpp index 0c39d9fe2f..71e6070399 100644 --- a/Core/CwCheat.cpp +++ b/Core/CwCheat.cpp @@ -30,10 +30,11 @@ void hleCheat(u64 userdata, int cyclesLate); static inline std::string TrimString(const std::string &s) { auto wsfront = std::find_if_not(s.begin(), s.end(), [](int c) { - return std::isspace(c); + // isspace() expects 0 - 255, so convert any sign-extended value. + return std::isspace(c & 0xFF); }); auto wsback = std::find_if_not(s.rbegin(), s.rend(), [](int c){ - return std::isspace(c); + return std::isspace(c & 0xFF); }).base(); return wsback > wsfront ? std::string(wsfront, wsback) : std::string(); }