rem: if (buffer->first + length < buffer->size) {
add: if (buffer->first + length <= buffer->size) {
context: read_from_buffer(struct ring_buffer *buffer, uint8 *data, ssize_t length,	bool user){	int32 available = buffer->in;	if (length > available)		length = available;	if (length == 0)		return 0;	ssize_t bytesRead = length;	if (buffer->first + length < buffer->size) {		// simple copy		if (user) {			if (user_memcpy(data, buffer->buffer + buffer->first, length) < B_OK)				return B_BAD_ADDRESS;		} else			memcpy(data, buffer->buffer + buffer->first, length);	} else {		// need to copy both ends		size_t upper = buffer->size - buffer->first;		size_t lower = length - upper;		if (user) {			if (user_memcpy(data, buffer->buffer + buffer->first, upper) < B_OK				|| user_memcpy(data + upper, buffer->buffer, lower) < B_OK)				return B_BAD_ADDRESS;		} else {			memcpy(data, buffer->buffer + buffer->first, upper);			memcpy(data + upper, buffer->buffer, lower);		}	}	buffer->first = (buffer->first + bytesRead) % buffer->size;	buffer->in -= bytesRead;	return bytesRead;}