mruby-dir: fix C4244 warning in mrb_dir_getwd function

use mrb_int for size variable and cast to size_t only when calling getcwd.
this maintains consistency with mruby type system while avoiding
conversion warnings on windows vc compiler.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-08-22 18:20:47 +09:00
parent 5ed11a61fe
commit 0ce99e442d
+1 -1
View File
@@ -178,7 +178,7 @@ mrb_dir_getwd(mrb_state *mrb, mrb_value klass)
mrb_int size = 64;
path = mrb_str_buf_new(mrb, size);
while (getcwd(RSTRING_PTR(path), size) == NULL) {
while (getcwd(RSTRING_PTR(path), (size_t)size) == NULL) {
int e = errno;
if (e != ERANGE) {
mrb_sys_fail(mrb, "getcwd(2)");