diff --git a/src/core/cheats.cpp b/src/core/cheats.cpp index 2a0dda220..9ee596c34 100644 --- a/src/core/cheats.cpp +++ b/src/core/cheats.cpp @@ -1371,8 +1371,10 @@ bool Cheats::ParseOptionRange(const std::string_view value, u16* out_range_start // OptionRange = 0:255 if (const std::string_view::size_type pos = value.rfind(':'); pos != std::string_view::npos) { - const std::optional start = StringUtil::FromChars(StringUtil::StripWhitespace(value.substr(0, pos))); - const std::optional end = StringUtil::FromChars(StringUtil::StripWhitespace(value.substr(pos + 1))); + const std::optional start = + StringUtil::FromCharsWithOptionalBase(StringUtil::StripWhitespace(value.substr(0, pos))); + const std::optional end = + StringUtil::FromCharsWithOptionalBase(StringUtil::StripWhitespace(value.substr(pos + 1))); if (start.has_value() && end.has_value() && start.value() <= std::numeric_limits::max() && end.value() <= std::numeric_limits::max() && end.value() > start.value()) { @@ -1961,7 +1963,7 @@ std::unique_ptr Cheats::GamesharkCheatCode::Parse(Me } size_t next_offset = 0; - while (next_offset < next.size() && !StringUtil::IsHexDigit(next[next_offset])) + while (next_offset < next.size() && next[next_offset] != '?' && !StringUtil::IsHexDigit(next[next_offset])) next_offset++; next = (next_offset < next.size()) ? next.substr(next_offset) : std::string_view();