From: Willy Tarreau Date: Tue, 27 Feb 2024 18:06:41 +0000 (+0100) Subject: BUILD: buf: make b_ncat() take a const for the source X-Git-Tag: v3.0-dev5~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=93a0fb74f47ca907aaccf634c0b63190964b17a8;p=thirdparty%2Fhaproxy.git BUILD: buf: make b_ncat() take a const for the source In 2.7 with commit 35df34223b ("MINOR: buffers: split b_force_xfer() into b_cpy() and b_force_xfer()"), b_ncat() was extracted from b_force_xfer() but kept its source variable instead of constant, making it unusable for calls from a const source. Let's just fix it. --- diff --git a/include/haproxy/buf.h b/include/haproxy/buf.h index e98161ebee..59484684a5 100644 --- a/include/haproxy/buf.h +++ b/include/haproxy/buf.h @@ -619,7 +619,7 @@ static inline size_t b_xfer(struct buffer *dst, struct buffer *src, size_t count * b_room(dst). * Returns the number of bytes copied. */ -static inline size_t b_ncat(struct buffer *dst, struct buffer *src, size_t count) +static inline size_t b_ncat(struct buffer *dst, const struct buffer *src, size_t count) { size_t ret, block1, block2;