diff options
Diffstat (limited to 'py/vstr.c')
-rw-r--r-- | py/vstr.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -52,9 +52,10 @@ void vstr_init(vstr_t *vstr, size_t alloc) { vstr->fixed_buf = false; } -// Init the vstr so it allocs exactly enough ram to hold given length, and set the length. +// Init the vstr so it allocs exactly enough ram to hold a null-terminated +// string of the given length, and set the length. void vstr_init_len(vstr_t *vstr, size_t len) { - vstr_init(vstr, len); + vstr_init(vstr, len + 1); vstr->len = len; } |