Fix generic_port_read()
Generic_port_read() was returning undefined values if read with out of bounds control index. This was breaking everything on certain builds.
This commit is contained in:
parent
c5633cc2ea
commit
ccde3f21be
1 changed files with 2 additions and 2 deletions
|
@ -1215,8 +1215,8 @@ inline short generic_port_read(const unsigned char* buffer, unsigned idx, unsign
|
|||
} else if(ctrl < analog_axis + buttons) {
|
||||
size_t bit = 16 * controllers * analog_axis + idx * buttons + ctrl - analog_axis;
|
||||
return ((buffer[bit / 8] & (1 << (bit % 8))) != 0);
|
||||
}
|
||||
|
||||
} else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue