Merge pull request #72 from masahino/add_pointer_casting

Add pointer casting
This commit is contained in:
Tomoyuki Sahara
2016-12-26 09:12:19 +09:00
committed by GitHub
+2 -2
View File
@@ -367,10 +367,10 @@ mrb_file_s_readlink(mrb_state *mrb, mrb_value klass) {
mrb_get_args(mrb, "z", &path);
buf = mrb_malloc(mrb, bufsize);
buf = (char *)mrb_malloc(mrb, bufsize);
while ((rc = readlink(path, buf, bufsize)) == bufsize && rc != -1) {
bufsize *= 2;
buf = mrb_realloc(mrb, buf, bufsize);
buf = (char *)mrb_realloc(mrb, buf, bufsize);
}
if (rc == -1) {
mrb_free(mrb, buf);