Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bc9c82fb authored by Kenny Root's avatar Kenny Root
Browse files

Use correct size of GAMEPAD_KEYCODES

Compute the actual number of indices in the GAMEPAD_KEYCODES instead of
the pure size in bytes.

Bug: 3121536
Change-Id: I71edbd8bf6eff2c8cc0ea5c6845362b3d1e06466
parent e739a525
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -818,7 +818,7 @@ int EventHub::openDevice(const char *deviceName) {
        }
        
        // See if this device has a gamepad.
        for (size_t i = 0; i < sizeof(GAMEPAD_KEYCODES); i++) {
        for (size_t i = 0; i < sizeof(GAMEPAD_KEYCODES)/sizeof(GAMEPAD_KEYCODES[0]); i++) {
            if (hasKeycodeLocked(device, GAMEPAD_KEYCODES[i])) {
                device->classes |= INPUT_DEVICE_CLASS_GAMEPAD;
                break;