--- a/src/cx/buffer.h Fri Dec 05 16:36:10 2025 +0100 +++ b/src/cx/buffer.h Fri Dec 05 16:38:17 2025 +0100 @@ -443,6 +443,8 @@ * Ensures that the buffer has the required capacity. * * If the current capacity is not sufficient, the buffer will be extended. + * If the current capacity is larger, the buffer is shrunk and superfluous + * content is discarded. * * This function will reserve no more bytes than requested, in contrast to * cxBufferMinimumCapacity(), which may reserve more bytes to improve the @@ -450,7 +452,7 @@ * * @param buffer the buffer * @param capacity the required capacity for this buffer - * @retval zero the capacity was already sufficient or successfully increased + * @retval zero on success * @retval non-zero on allocation failure * @see cxBufferShrink() * @see cxBufferMinimumCapacity()