diff options
| author | Yukihiro Matsumoto <[email protected]> | 2012-06-03 09:09:40 +0900 |
|---|---|---|
| committer | Yukihiro Matsumoto <[email protected]> | 2012-06-03 09:09:40 +0900 |
| commit | 6c2c5540e2cb549579836d9a80417b18a296344c (patch) | |
| tree | 0c108b4e6c709ae80d1a02167f70b18d02fcdc04 | |
| parent | 52fdeb02253b31616f92ec4e5bdcd365998c21bd (diff) | |
| download | mruby-6c2c5540e2cb549579836d9a80417b18a296344c.tar.gz mruby-6c2c5540e2cb549579836d9a80417b18a296344c.zip | |
should initialize shared->buf as well as s->buf
| -rw-r--r-- | src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c index 6d37597d8..8bc299987 100644 --- a/src/string.c +++ b/src/string.c @@ -265,7 +265,7 @@ str_make_shared(mrb_state *mrb, mrb_value str) shared->refcnt = 1; if (s->aux.capa > s->len) { - shared->buf = mrb_realloc(mrb, shared->buf, s->len+1); + s->buf = shared->buf = mrb_realloc(mrb, s->buf, s->len+1); } else { shared->buf = s->buf; |
