]> git.meshlink.io Git - utcp/commitdiff
Fix buffer resizing.
authorGuus Sliepen <guus@sliepen.org>
Sun, 29 Mar 2020 16:08:40 +0000 (18:08 +0200)
committerGuus Sliepen <guus@sliepen.org>
Sun, 29 Mar 2020 16:08:40 +0000 (18:08 +0200)
utcp.c

diff --git a/utcp.c b/utcp.c
index b5102dd7c907015ed7b87c5bd31844e462601e2d..3d0971a37ba359716533ddaeab9b03874473d510 100644 (file)
--- 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;
        }