diff options
Diffstat (limited to 'src/string.c')
| -rw-r--r-- | src/string.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string.c b/src/string.c index 088f8efc4..fa581f025 100644 --- a/src/string.c +++ b/src/string.c @@ -62,6 +62,7 @@ mrb_str_modify(mrb_state *mrb, struct RString *s) if (shared->refcnt == 1 && s->ptr == shared->ptr) { s->ptr = shared->ptr; s->aux.capa = shared->len; + s->ptr[s->len] = '\0'; mrb_free(mrb, shared); } else { |
