Add type cast to readline(2) return value.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-12-07 20:26:34 +09:00
parent 764a568aa4
commit bc9e3e6fd0
+1 -1
View File
@@ -370,7 +370,7 @@ mrb_file_s_readlink(mrb_state *mrb, mrb_value klass) {
mrb_get_args(mrb, "z", &path);
buf = (char *)mrb_malloc(mrb, bufsize);
while ((rc = readlink(path, buf, bufsize)) == bufsize && rc != -1) {
while ((rc = readlink(path, buf, bufsize)) == (ssize_t)bufsize && rc != -1) {
bufsize *= 2;
buf = (char *)mrb_realloc(mrb, buf, bufsize);
}