From 1942629d9aa21729b0adf71ed65cab57a62b89a2 Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Fri, 25 Mar 2022 09:48:16 +0100 Subject: [PATCH] DolphinQt/CheatSearchWidget: Drop whitespace when parsing integers and floats from the user. --- Source/Core/DolphinQt/CheatSearchWidget.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinQt/CheatSearchWidget.cpp b/Source/Core/DolphinQt/CheatSearchWidget.cpp index ccbd90f131..e07a5c4ecb 100644 --- a/Source/Core/DolphinQt/CheatSearchWidget.cpp +++ b/Source/Core/DolphinQt/CheatSearchWidget.cpp @@ -276,7 +276,10 @@ void CheatSearchWidget::OnNextScanClicked() m_session->SetCompareType(m_compare_type_dropdown->currentData().value()); if (filter_type == Cheats::FilterType::CompareAgainstSpecificValue) { - if (!m_session->SetValueFromString(m_given_value_text->text().toStdString(), + QString search_value = m_given_value_text->text(); + if (m_session->IsIntegerType() || m_session->IsFloatingType()) + search_value = search_value.simplified().remove(QLatin1Char(' ')); + if (!m_session->SetValueFromString(search_value.toStdString(), m_parse_values_as_hex_checkbox->isChecked())) { m_info_label_1->setText(tr("Failed to parse given value into target data type."));