libds

a collection of simple data structures
Log | Files | Refs | LICENSE

commit 41d68480466147ad3dc75260e69a3321cf978fcb
parent 79305390876395bbd5e1d7de4c598425d4347689
Author: sin <sin@2f30.org>
Date:   Tue,  8 Apr 2014 10:16:23 +0100

Fix vertical spacing in fifo

Diffstat:
Mfifo.c | 3---
1 file changed, 0 insertions(+), 3 deletions(-)

diff --git a/fifo.c b/fifo.c @@ -41,13 +41,11 @@ fifo_enqueue(struct fifo *fifo, const void *buf, size_t sz) if (!sz) return 0; - if (fifo->cap - fifo->sz >= sz) { memcpy(fifo->buf + fifo->sz, buf, sz); fifo->sz += sz; return 0; } - tmp = realloc(fifo->buf, fifo->cap + sz); if (!tmp) return -1; @@ -63,7 +61,6 @@ fifo_dequeue(struct fifo *fifo, void *buf, size_t sz) { if (!sz) return 0; - if (fifo->sz < sz) return -1; memcpy(buf, fifo->buf, sz);