From 4f52c6756608a7d7ee6f43498c24aa7f5c74466d Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 4 Mar 2025 19:44:39 +0100 Subject: [PATCH] static analysis: suspicious code --- rpcs3/Input/mm_joystick_handler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rpcs3/Input/mm_joystick_handler.cpp b/rpcs3/Input/mm_joystick_handler.cpp index 112620bf37..7c483732fc 100644 --- a/rpcs3/Input/mm_joystick_handler.cpp +++ b/rpcs3/Input/mm_joystick_handler.cpp @@ -77,7 +77,7 @@ bool mm_joystick_handler::Init() m_devices.clear(); m_max_devices = joyGetNumDevs(); - if (m_max_devices <= 0) + if (!m_max_devices) { input_log.error("mmjoy: Driver doesn't support Joysticks"); return false; @@ -408,7 +408,7 @@ std::unordered_map mm_joystick_handler::GetButtonValues(const JOYINFOE if (entry.first == NO_BUTTON) continue; - button_values.emplace(entry.first, js_info.dwButtons & entry.first ? 255 : 0); + button_values.emplace(entry.first, (js_info.dwButtons & entry.first) ? 255 : 0); } if (js_caps.wCaps & JOYCAPS_HASPOV)