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:
parent
57b41474af
commit
03c3404413
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user