1
0
mirror of https://github.com/mist-devel/mist-firmware.git synced 2026-01-13 15:17:43 +00:00

Fix a buffer index error (count = 0 -> buffer index = -1) in joymapping

This commit is contained in:
Gyorgy Szombathelyi 2019-04-18 19:08:00 +02:00
parent 57b41474af
commit 03c3404413

View File

@ -95,11 +95,10 @@ void virtual_joystick_remap(char *s) {
token = strtok (s, ",");
while(token!=NULL) {
//if (count==0) joystick_mappers[i].vid = strtol(token, NULL, 16); -- VID mapping already done
value = strtol(token, NULL, 16);
value = strtol(token, NULL, 16);
if (count==1) {
joystick_mappers[i].pid = value;
}
else {
} else if (count >= 2) {
//parse sub-tokens sequentially and assign 16-bit value to them
joystick_mappers[i].mapping[off+count-2] = value;
hid_debugf("parsed: %x/%x %d -> %d",