diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-06-12 12:49:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-12 12:49:21 +0200 |
commit | 971b5160c61ccb7a009966d17d339997ea343da3 (patch) | |
tree | ff0d038213821bbf258f9fa9fd36288a7c7d9bbc /platform/x11/joypad_linux.cpp | |
parent | f160c81f683d8a523f23d3c4f7a76151a75fe875 (diff) | |
parent | 8245db869f05a86e88338236d22765b87cc71db8 (diff) |
Merge pull request #29306 from qarmin/small_code_fixes
Small fixes to unrechable code, possibly overflows, using NULL pointers
Diffstat (limited to 'platform/x11/joypad_linux.cpp')
-rw-r--r-- | platform/x11/joypad_linux.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/x11/joypad_linux.cpp b/platform/x11/joypad_linux.cpp index c4dd8fe0e0..3e9e8033e8 100644 --- a/platform/x11/joypad_linux.cpp +++ b/platform/x11/joypad_linux.cpp @@ -444,10 +444,10 @@ InputDefault::JoyAxis JoypadLinux::axis_correct(const input_absinfo *p_abs, int jx.min = -1; if (p_value < 0) { jx.value = (float)-p_value / min; + } else { + jx.value = (float)p_value / max; } - jx.value = (float)p_value / max; - } - if (min == 0) { + } else if (min == 0) { jx.min = 0; jx.value = 0.0f + (float)p_value / max; } |