From: Ekdohibs Date: Tue, 18 Apr 2017 04:40:53 +0000 (+0200) Subject: Fix always using the xbox layout (reported by coverity). X-Git-Tag: 0.4.16~233 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eddf16eee9cb3627f4f62d37ea2942fc7546fae7;p=oweals%2Fminetest.git Fix always using the xbox layout (reported by coverity). --- diff --git a/src/client/joystick_controller.cpp b/src/client/joystick_controller.cpp index e6a572adb..3e1442793 100644 --- a/src/client/joystick_controller.cpp +++ b/src/client/joystick_controller.cpp @@ -186,7 +186,7 @@ void JoystickController::onJoystickConnect(const std::vector } void JoystickController::setLayoutFromControllerName(std::string name) { - if (lowercase(name).find("xbox") >= 0) { + if (lowercase(name).find("xbox") != std::string::npos) { m_layout = create_xbox_layout(); } else { m_layout = create_default_layout();