Seeed-Studio / Grove_Digital_Light_Sensor

TSL2561 & ISL29035
MIT License
13 stars 14 forks source link

Fix writing past the end of the _intg_time buffer #6

Closed Abestanis closed 2 years ago

Abestanis commented 2 years ago

_intg_time is declared with a size of 4 here: https://github.com/Seeed-Studio/Grove_Digital_Light_Sensor/blob/457fcf7454b02fb33d95b1154ce73c27e2346cb2/Digital_Light_ISL29035.h#L99

Yet during construction, the code writes to the 5th element: https://github.com/Seeed-Studio/Grove_Digital_Light_Sensor/blob/457fcf7454b02fb33d95b1154ce73c27e2346cb2/Digital_Light_ISL29035.cpp#L45

It looks like a simple typo. This pull request corrects the off-by-one.