Probably fix bug #51602: MQTT Ring buffer 'get'

Rollover of get index was wrong
This commit is contained in:
Dirk Ziegelmeier 2017-07-28 08:01:30 +02:00
parent ff03ae6f55
commit ca76c302f1

View File

@ -204,7 +204,7 @@ mqtt_ringbuf_advance_get_idx(struct mqtt_ringbuf_t *rb, u16_t len)
LWIP_ASSERT("mqtt_ringbuf_advance_get_idx: len < MQTT_OUTPUT_RINGBUF_SIZE", len < MQTT_OUTPUT_RINGBUF_SIZE);
rb->get += len;
if (rb->get > MQTT_OUTPUT_RINGBUF_SIZE) {
if (rb->get >= MQTT_OUTPUT_RINGBUF_SIZE) {
rb->get = rb->get - MQTT_OUTPUT_RINGBUF_SIZE;
}
}