diff options
| author | 2010-10-21 15:46:03 -0700 | |
|---|---|---|
| committer | 2010-10-21 15:46:03 -0700 | |
| commit | 1d79a9d9f85f932a1fd6dcddba335450b65ba4e6 (patch) | |
| tree | 4c25f01396a8fed470404bbd92aa2af90df205b0 | |
| parent | 703aae06c0925b19657877bb1872bb2f28874969 (diff) | |
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
| -rw-r--r-- | libs/ui/EventHub.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp index 944731dba672..5c618fb50fca 100644 --- a/libs/ui/EventHub.cpp +++ b/libs/ui/EventHub.cpp @@ -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; |