From 139b577cbeccd495038da51a8a3ddc8eb3397a4d Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 23 Sep 2023 00:56:49 +0000 Subject: Sometimes, memmove is unavoidable. Signed-off-by: Laurent Bercot --- src/libtipidee/tipidee_headers_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libtipidee') diff --git a/src/libtipidee/tipidee_headers_parse.c b/src/libtipidee/tipidee_headers_parse.c index eed0727..ca14ca5 100644 --- a/src/libtipidee/tipidee_headers_parse.c +++ b/src/libtipidee/tipidee_headers_parse.c @@ -165,7 +165,7 @@ static int tipidee_headers_parse_with (buffer *b, tipidee_headers *hdr, get1_fun LOLDEBUG(" consecutive headers -> concatenating") ; hdr->buf[start - 1] = ',' ; hdr->buf[start] = ' ' ; - memcpy(hdr->buf + start + 1, hdr->buf + header->right, hdr->len - header->right) ; + memmove(hdr->buf + start + 1, hdr->buf + header->right, hdr->len - header->right) ; } else { @@ -176,7 +176,7 @@ static int tipidee_headers_parse_with (buffer *b, tipidee_headers *hdr, get1_fun memcpy(tmp, hdr->buf + start, len) ; hdr->buf[start - 1] = ',' ; hdr->buf[start] = ' ' ; - memcpy(hdr->buf + start + 1, hdr->buf + header->right, hdr->len - header->right) ; + memmove(hdr->buf + start + 1, hdr->buf + header->right, hdr->len - header->right) ; memcpy(hdr->buf + start + offset, tmp, len) ; for (uint32_t i = prev + 1 ; i < hdr->n ; i++) { -- cgit v1.2.3