rem: }
context: cbuf_truncate_tail(cbuf *buffer, size_t truncBytes){	cbuf *head = buffer;	size_t bufferOffset;	size_t offset;	if (!buffer || (buffer->flags & CBUF_FLAG_CHAIN_HEAD) == 0)		return B_BAD_VALUE;	offset = buffer->total_length - truncBytes;		// ToDo: what happens if truncBytes >= total_length??	bufferOffset = 0;	while (buffer && offset > 0) {		if (offset < buffer->length) {			// this is the one			bufferOffset = offset;			break;		}		offset -= buffer->length;		buffer = buffer->next;	}	if (!buffer)		return B_ERROR;	head->total_length -= buffer->length - bufferOffset;	buffer->length -= bufferOffset;		// ToDo: is this correct?		// Isn't bufferOffset the part that has to stay in the buffer?		// can't we just have head->total_length -= truncBytes?	// clear out the rest of the buffers in this chain	while ((buffer = buffer->next) != NULL) {		head->total_length -= buffer->length;		buffer->length = 0;	}	return B_OK;}