If the reason for modifying the loop is readability, what do you think of this:

```c
  for (rv = 0;  rv < count; rv++) {
        buf[rv] = in_buffer.data[in_buffer.rpos];
        in_buffer.rpos++;
        if (in_buffer.rpos == in_buffer.wpos) {
          break;
        }
  }
```