diff options
Diffstat (limited to 'core/ring_buffer.h')
-rw-r--r-- | core/ring_buffer.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/ring_buffer.h b/core/ring_buffer.h index de33de0c76..3cf9cf9064 100644 --- a/core/ring_buffer.h +++ b/core/ring_buffer.h @@ -141,15 +141,15 @@ public: inline int space_left() { int left = read_pos - write_pos; if (left < 0) { - return size() + left; + return size() + left - 1; }; if (left == 0) { - return size(); + return size()-1; }; - return left; + return left -1; }; inline int data_left() { - return size() - space_left(); + return size() - space_left() - 1; }; inline int size() { |