mirror of https://git.kore.io/kore.git
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:
commit
0aae500e2f
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue