mruby/mruby — pull request #1487 by h2so5 (2013-08-23 22:21:39+00:00)
Title: Fix a problem of 'z' option and shared string

'z' option in ```mrb_get_args``` doesn't expect a shared string.
It assumes that the string is null-terminated correctly.

This test program shows the problem.
```test_func``` receives "ab", but the output is "abcdefg".

```c
#include
#include
#include

static mrb_value
mrb_test_func(mrb_state *mrb, mrb_value self)
{
char *str = NULL;
mrb_get_args(mrb, "z", &str);
puts(str);
return mrb_nil_value();
}

int main()
{
mrb_state *mrb = mrb_open();
mrb_define_method(mrb, mrb->kernel_module, "test_func", mrb_test_func, ARGS_REQ(1));
mrb_load_string(mrb, " test_func 'abcdefg'[0, 2] ");
mrb_close(mrb);
return 0;
}
```