Commit 26e0319e authored by Masamitsu MURASE's avatar Masamitsu MURASE

Modify buffer size for filename.

parent 64762fb1
......@@ -4810,9 +4810,9 @@ mrbc_filename(mrb_state *mrb, mrbc_context *c, const char *s)
{
if (s) {
int len = strlen(s);
char *p = (char *)mrb_malloc(mrb, len);
char *p = (char *)mrb_malloc(mrb, len + 1);
memcpy(p, s, len);
memcpy(p, s, len + 1);
if (c->filename) mrb_free(mrb, c->filename);
c->filename = p;
c->lineno = 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment