bufix of mrb_file__gethome()

This commit is contained in:
Akira Yumiyama
2013-05-12 14:58:12 +09:00
parent e277079616
commit 0a21d9ec92
+2 -2
View File
@@ -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;