summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--py/vstr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/vstr.c b/py/vstr.c
index 55c597bb12..181b1c49b9 100644
--- a/py/vstr.c
+++ b/py/vstr.c
@@ -151,7 +151,7 @@ STATIC bool vstr_ensure_extra(vstr_t *vstr, size_t size) {
if (vstr->fixed_buf) {
return false;
}
- size_t new_alloc = ROUND_ALLOC((vstr->len + size) * 2);
+ size_t new_alloc = ROUND_ALLOC((vstr->len + size) + 64);
char *new_buf = m_renew(char, vstr->buf, vstr->alloc, new_alloc);
if (new_buf == NULL) {
vstr->had_error = true;