pbuf_copy_partial_pbuf: fix warning about assigning to smaller type when using '-=' operator

Signed-off-by: Simon Goldschmidt <goldsimon@gmx.de>
This commit is contained in:
Simon Goldschmidt 2022-12-22 20:43:18 +01:00
parent 4b7a54c06c
commit 790b914fea

View File

@ -1011,7 +1011,7 @@ pbuf_copy_partial_pbuf(struct pbuf *p_to, const struct pbuf *p_from, u16_t copy_
MEMCPY((u8_t *)p_to->payload + offset_to, (u8_t *)p_from->payload + offset_from, len); MEMCPY((u8_t *)p_to->payload + offset_to, (u8_t *)p_from->payload + offset_from, len);
offset_to += len; offset_to += len;
offset_from += len; offset_from += len;
copy_len -= len; copy_len = (u16_t)(copy_len - len);
LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len); LWIP_ASSERT("offset_to <= p_to->len", offset_to <= p_to->len);
LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len); LWIP_ASSERT("offset_from <= p_from->len", offset_from <= p_from->len);
if (offset_from >= p_from->len) { if (offset_from >= p_from->len) {