From: Guus Sliepen Date: Sun, 29 Mar 2020 16:08:40 +0000 (+0200) Subject: Fix buffer resizing. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=372fb44a395d6ded38d6e52472a0f2f330c232c3;p=utcp Fix buffer resizing. --- diff --git a/utcp.c b/utcp.c index b5102dd..3d0971a 100644 --- a/utcp.c +++ b/utcp.c @@ -220,7 +220,7 @@ static bool buffer_resize(struct buffer *buf, uint32_t newsize) { // [345.........|........012] uint32_t tailsize = buf->size - buf->offset; uint32_t newoffset = newsize - tailsize; - memmove(buf + newoffset, buf + buf->offset, tailsize); + memmove(buf->data + newoffset, buf->data + buf->offset, tailsize); buf->offset = newoffset; }