Closed dragoncoder047 closed 1 year ago
Somehow I managed to hit a weird edge case in (restart-i2c) -- it segfaults if stream is nil. You'd never think that could happen but it did.
(restart-i2c)
Fix:
object *fn_restarti2c (object *args, object *env) { (void) env; - int stream = first(args)->integer; + int stream = isstream(first(args)); args = cdr(args); int read = 0; // Write I2Ccount = 0; if (args != NULL) { object *rw = first(args); if (integerp(rw)) I2Ccount = rw->integer; read = (rw != NULL); } int address = stream & 0xFF; if (stream>>8 != I2CSTREAM) error2(PSTR("not an i2c stream")); return I2Crestart(address, read) ? tee : nil; }
Good find - I'll fix that.
Somehow I managed to hit a weird edge case in
(restart-i2c)
-- it segfaults if stream is nil. You'd never think that could happen but it did.Fix: