Skip to content

Commit

Permalink
Version 1.4.1 (re-commit 2)
Browse files Browse the repository at this point in the history
Fixed RingBuf_Dequeue doesn't work and always returns 0 (if operator syntax mistake)
  • Loading branch information
t1m013y committed Nov 11, 2023
1 parent 10b30c9 commit 03d6e1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# RingBuf-c v1.4. documentation
# RingBuf-c v1.4.1 documentation

A ring buffer (FIFO) for C and C++ languages.

Expand Down
5 changes: 3 additions & 2 deletions src/RingBuf.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
RingBuf-c
v1.4
v1.4.1
https://github.com/t1m013y/RingBuf-c
By Timofey Fomin (https://github.com/t1m013y, [email protected])
*/
Expand Down Expand Up @@ -123,9 +123,10 @@ int RingBuf_Dequeue(RingBuf* buffer_h, char* data)
if (!RingBuf__Lock(buffer_h))
return 0;

if (!(buffer_h->elements_count > 0))
if (!(buffer_h->elements_count > 0)) {
RingBuf__Unlock(buffer_h);
return 0;
}

char* read_addr = (char*)(buffer_h->buffer + buffer_h->tail_index);

Expand Down
2 changes: 1 addition & 1 deletion src/RingBuf.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
RingBuf-c
v1.4
v1.4.1
https://github.com/t1m013y/RingBuf-c
By Timofey Fomin (https://github.com/t1m013y, [email protected])
*/
Expand Down

0 comments on commit 03d6e1a

Please sign in to comment.