on line 149 of microrl.c, it seems that it should be if (pThis->ring_buf [header] + header + 1 < _RING_HISTORY_LEN) { ^^^^ with original test, i had crash, because there can be an out of bound read on tle following memcpy.