diff --git a/src/common/Settings.cpp b/src/common/Settings.cpp index d7ea2cb38..dd47a9b5f 100644 --- a/src/common/Settings.cpp +++ b/src/common/Settings.cpp @@ -947,12 +947,9 @@ void Settings::RemoveLegacyConfigs(unsigned int CurrentRevision) std::string current_section = std::string(section_input_port) + std::to_string(port_num); std::string device_name = m_si.GetValue(current_section.c_str(), sect_input_port.device, ""); - // NOTE: with C++20, this can be simplified by simply calling device_name.ends_with() - if (device_name.length() >= kb_str.length()) { - if (device_name.compare(device_name.length() - kb_str.length(), kb_str.length(), kb_str) == 0) { - device_name += "Mouse"; - m_si.SetValue(current_section.c_str(), sect_input_port.device, device_name.c_str(), nullptr, true); - } + if (StrEndsWith(device_name, kb_str)) { + device_name += "Mouse"; + m_si.SetValue(current_section.c_str(), sect_input_port.device, device_name.c_str(), nullptr, true); } } diff --git a/src/common/input/Button.cpp b/src/common/input/Button.cpp index 643974378..d793b0e31 100644 --- a/src/common/input/Button.cpp +++ b/src/common/input/Button.cpp @@ -63,10 +63,16 @@ LRESULT CALLBACK ButtonDukeSubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPA case WM_RBUTTONDOWN: { Button *button = reinterpret_cast