mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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)");
|
||||
|
||||
Reference in New Issue
Block a user