Commit fdea41e3 authored by David Zeuthen's avatar David Zeuthen
Browse files

clear the right block when growing a string

parent d0d42aa2
......@@ -853,9 +853,9 @@ kit_string_ensure_size (KitString *s, size_t new_size)
if (p == NULL)
goto oom;
/* zero the new block we got */
memset (s->buf + s->buf_len, 0, grow_to - s->buf_len);
s->buf = p;
s->buf_len += KIT_STRING_BLOCK_SIZE;
memset (s->buf + s->buf_len, 0, grow_to - s->buf_len);
s->buf_len = grow_to;
}
return TRUE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment