Merge pull request #101 from CarlEkerot/ce-buf-append-fix

Don't reallocate a buffer if we do not need to.
This commit is contained in:
Joris Vink 2016-01-09 13:40:15 +01:00
commit 0aae500e2f
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ kore_buf_create(u_int32_t initial)
void
kore_buf_append(struct kore_buf *buf, const void *d, u_int32_t len)
{
if ((buf->offset + len) >= buf->length) {
if ((buf->offset + len) > buf->length) {
buf->length += len + KORE_BUF_INCREMENT;
buf->data = kore_realloc(buf->data, buf->length);
}