diff -r aed60ba37acf -r 24a012440dee ucx/buffer.h --- a/ucx/buffer.h Tue May 06 10:56:54 2014 +0200 +++ b/ucx/buffer.h Tue May 06 12:03:16 2014 +0200 @@ -120,8 +120,7 @@ * * @param src the source buffer * @param start the start position of extraction - * @param length the count of bytes to extract or 0 if all of the remaining - * bytes shall be extracted + * @param length the count of bytes to extract (must not be zero) * @param flags feature mask for the new buffer * @return a new buffer containing the extraction */ @@ -136,7 +135,7 @@ * @return a new buffer with the extracted content */ #define ucx_buffer_clone(src,flags) \ - ucx_buffer_extract(src, 0, 0, flags) + ucx_buffer_extract(src, 0, (src)->capacity, flags) /** * Moves the position of the buffer. @@ -186,12 +185,12 @@ * the buffer capacity is doubled, as long as it would not hold the current * content plus the additional required bytes. * - * Attention: the argument provided is the count of additional - * bytes the buffer shall hold. It is NOT the total count of bytes the + * Attention: the argument provided is the number of additional + * bytes the buffer shall hold. It is NOT the total number of bytes the * buffer shall hold. * * @param buffer the buffer to extend - * @param additional_bytes the count of additional bytes the buffer shall + * @param additional_bytes the number of additional bytes the buffer shall * at least hold * @return 0 on success or a non-zero value on failure */