Commit 0a21d9ec authored by Akira Yumiyama's avatar Akira Yumiyama

bufix of mrb_file__gethome()

parent e2770796
...@@ -265,8 +265,8 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) ...@@ -265,8 +265,8 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
} }
} }
result = mrb_str_buf_new(mrb, strlen(home)); result = mrb_str_buf_new(mrb, MAXPATHLEN);
strncpy(RSTRING_PTR(result), home, strlen(home)); strncpy(RSTRING_PTR(result), home, MAXPATHLEN);
mrb_str_resize(mrb, result, strlen(RSTRING_PTR(result))); mrb_str_resize(mrb, result, strlen(RSTRING_PTR(result)));
return result; return result;
......
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