mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
bufix of mrb_file__gethome()
This commit is contained in:
+2
-2
@@ -265,8 +265,8 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass)
|
||||
}
|
||||
}
|
||||
|
||||
result = mrb_str_buf_new(mrb, strlen(home));
|
||||
strncpy(RSTRING_PTR(result), home, strlen(home));
|
||||
result = mrb_str_buf_new(mrb, MAXPATHLEN);
|
||||
strncpy(RSTRING_PTR(result), home, MAXPATHLEN);
|
||||
mrb_str_resize(mrb, result, strlen(RSTRING_PTR(result)));
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user