diff --git a/src/uhttp_buf.c b/src/uhttp_buf.c index e549019..a81a85f 100755 --- a/src/uhttp_buf.c +++ b/src/uhttp_buf.c @@ -49,7 +49,7 @@ size_t uh_buf_append(struct uh_buf *buf, const void *data, size_t len) return 0; if (buf->len + len > buf->size) { - if (uh_buf_grow(buf, len * UH_BUF_SIZE_MULTIPLIER) == -1) + if (uh_buf_grow(buf, len << UH_BUF_SIZE_MULTIPLIER) == -1) len = buf->size - buf->len; } diff --git a/src/uhttp_buf.h b/src/uhttp_buf.h index 0b528d9..d5cef12 100755 --- a/src/uhttp_buf.h +++ b/src/uhttp_buf.h @@ -5,7 +5,7 @@ #include #include -#define UH_BUF_SIZE_MULTIPLIER 1.5 +#define UH_BUF_SIZE_MULTIPLIER 3 struct uh_buf { char *base; /* Buffer pointer */