diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c index 589f1be14..8f195aa70 100644 --- a/mrbgems/mruby-io/src/file.c +++ b/mrbgems/mruby-io/src/file.c @@ -381,7 +381,7 @@ mrb_file__gethome(mrb_state *mrb, mrb_value klass) char *pathp = RSTRING_PTR(path); const char *const pathend = pathp + RSTRING_LEN(path); for (;;) { - pathp = memchr((void*)pathp, '\\', (size_t)(pathend - pathp)); + pathp = (char*)memchr((void*)pathp, '\\', (size_t)(pathend - pathp)); if (!pathp) break; *pathp++ = '/'; } diff --git a/mrbgems/mruby-io/test/mruby_io_test.c b/mrbgems/mruby-io/test/mruby_io_test.c index d47e20cad..f11c960c2 100644 --- a/mrbgems/mruby-io/test/mruby_io_test.c +++ b/mrbgems/mruby-io/test/mruby_io_test.c @@ -257,7 +257,7 @@ mrb_mruby_io_gem_test(mrb_state* mrb) char *pathp = RSTRING_PTR(path); const char *const pathend = pathp + RSTRING_LEN(path); for (;;) { - pathp = memchr(pathp, '\\', pathend - pathp); + pathp = (char*)memchr(pathp, '\\', pathend - pathp); if (!pathp) break; *pathp++ = '/'; }