From 89e9249b925ad1648e8df16d2736075b5f59a117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Sun, 29 Nov 2015 13:05:31 +0100 Subject: [PATCH] bugfix in partial write --- circbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circbuf.c b/circbuf.c index 764c2ae..aca9411 100644 --- a/circbuf.c +++ b/circbuf.c @@ -107,7 +107,7 @@ uint16_t cbuf_write_partial(CircularBuffer *inst, const uint8_t *b, uint16_t max { uint16_t i; for (i = 0; i < max; i++) { - if (cbuf_empty(inst)) break; + if (cbuf_full(inst)) break; cbuf_write(inst, *(b + i)); }