From fae478dae56b193a5aef2e0964501f64697ba11d Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 28 Jan 2026 15:02:20 +0100 Subject: [PATCH] MINOR: buffers: Swap buffers of same size only In b_xfer(), we now take care to swap buffers of the same size only. For now, it is always the case. But that will change. --- src/buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/buf.c b/src/buf.c index afe33110b..19f38e504 100644 --- a/src/buf.c +++ b/src/buf.c @@ -348,7 +348,7 @@ size_t b_xfer(struct buffer *dst, struct buffer *src, size_t count) if (ret > count) ret = count; - else if (!b_data(dst)) { + else if (!b_data(dst) && b_size(dst) == b_size(src)) { /* zero copy is possible by just swapping buffers */ struct buffer tmp = *dst; *dst = *src;