diff options
author | Richard Braun <rbraun@sceen.net> | 2018-09-17 00:28:18 +0200 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-09-17 00:28:18 +0200 |
commit | 562033bdc83fcd0ceff958faf1ce070ca1c48eec (patch) | |
tree | dfb74ebae2442040e135d16f11f8f39754d2616d /src | |
parent | b7bb9e691d29f31d35fe866068ba3cf16e2ef338 (diff) |
cbuf: fix invalid overflow check
This change fixes a check that would incorrectly consider a size of 0
as an overflow.
Diffstat (limited to 'src')
-rw-r--r-- | src/cbuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -164,7 +164,7 @@ cbuf_write(struct cbuf *cbuf, size_t index, const void *buf, size_t size) end = start + size; buf_end = cbuf->buf + cbuf->capacity; - if ((end <= cbuf->buf) || (end > buf_end)) { + if ((end < cbuf->buf) || (end > buf_end)) { skip = buf_end - start; memcpy(start, buf, skip); buf += skip; |