fix pbuf_split_64k() for zero-length pbufs

This commit is contained in:
goldsimon 2017-08-21 22:08:53 +02:00
parent b9d3812ee8
commit 3c5398403d

View File

@ -1122,7 +1122,7 @@ void pbuf_split_64k(struct pbuf *p, struct pbuf **rest)
struct pbuf *r = p->next; struct pbuf *r = p->next;
/* continue until the total length (summed up as u16_t) overflows */ /* continue until the total length (summed up as u16_t) overflows */
while ((r != NULL) && ((u16_t)(tot_len_front + r->len) > tot_len_front)) { while ((r != NULL) && ((u16_t)(tot_len_front + r->len) >= tot_len_front)) {
tot_len_front = (u16_t)(tot_len_front + r->len); tot_len_front = (u16_t)(tot_len_front + r->len);
i = r; i = r;
r = r->next; r = r->next;