diff options
| author | h2so5 <[email protected]> | 2013-08-24 06:49:58 +0900 |
|---|---|---|
| committer | h2so5 <[email protected]> | 2013-08-24 06:52:46 +0900 |
| commit | 23df879a81161a0b87721f422ca7e68f63f6746e (patch) | |
| tree | 75e0d14f451b8b4ccbdda6f2b057a01ae701f4a3 /src/string.c | |
| parent | aa099f7f7d1f8c61db936fb7c39a3c734175af16 (diff) | |
| download | mruby-23df879a81161a0b87721f422ca7e68f63f6746e.tar.gz mruby-23df879a81161a0b87721f422ca7e68f63f6746e.zip | |
Fix a problem of 'z' option and shared string
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 2004c9fe8..88dcfc63e 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 { |
