mraa: with NULL platform board max counts need to be checked to >= not just >
This fixes bugs when USBPLAT or FIRMATA is enabled when a NULL platform is added or even a platform without ADC Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -107,7 +107,7 @@ mraa_aio_init(unsigned int aio)
|
||||
syslog(LOG_ERR, "aio: pin %i beyond platform definition", pin);
|
||||
return NULL;
|
||||
}
|
||||
if (aio > board->aio_count) {
|
||||
if (aio >= board->aio_count) {
|
||||
syslog(LOG_ERR, "aio: requested channel out of range");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user