From 790b914feacd7635afb7a341113caf52b036c0b1 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 22 Dec 2022 20:43:18 +0100 Subject: [PATCH] pbuf_copy_partial_pbuf: fix warning about assigning to smaller type when using '-=' operator Signed-off-by: Simon Goldschmidt --- src/core/pbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/pbuf.c b/src/core/pbuf.c index 4da1bd5c..ea5e026c 100644 --- a/src/core/pbuf.c +++ b/src/core/pbuf.c @@ -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); offset_to += 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_from <= p_from->len", offset_from <= p_from->len); if (offset_from >= p_from->len) {