diff --git a/src/mono/mono/metadata/assembly.c b/src/mono/mono/metadata/assembly.c index c1dad75ea980f8..3b89baefe2e53a 100644 --- a/src/mono/mono/metadata/assembly.c +++ b/src/mono/mono/metadata/assembly.c @@ -2139,10 +2139,8 @@ mono_assembly_request_load_from (MonoImage *image, const char *fname, gchar *tmp_fn; tmp_fn = g_strdup (fname); - for (size_t i = strlen (tmp_fn) - 1; i >= 0; i--) { - if (tmp_fn [i] == '/') - tmp_fn [i] = '\\'; - } + + g_strdelimit (tmp_fn, '/', '\\'); base_dir = absolute_dir (tmp_fn); g_free (tmp_fn); diff --git a/src/mono/mono/metadata/icall.c b/src/mono/mono/metadata/icall.c index 8d3bb497b38648..bdb83dad31a541 100644 --- a/src/mono/mono/metadata/icall.c +++ b/src/mono/mono/metadata/icall.c @@ -167,9 +167,7 @@ is_generic_parameter (MonoType *type) static void mono_icall_make_platform_path (gchar *path) { - for (size_t i = strlen (path); i > 0; i--) - if (path [i-1] == '\\') - path [i-1] = '/'; + g_strdelimit (path, '\\', '/'); } static const gchar * diff --git a/src/mono/mono/metadata/w32handle.c b/src/mono/mono/metadata/w32handle.c index 927bb3c6be3bf3..6ecec42af5d79d 100644 --- a/src/mono/mono/metadata/w32handle.c +++ b/src/mono/mono/metadata/w32handle.c @@ -508,7 +508,7 @@ mono_w32handle_ops_prewait (MonoW32Handle *handle_data) static void mono_w32handle_unlock_handles (MonoW32Handle **handles_data, gsize nhandles) { - for (gsize i = nhandles - 1; i >= 0; i--) { + for (int i = ((int)nhandles - 1); i >= 0; i--) { if (!handles_data [i]) continue; mono_w32handle_unlock (handles_data [i]);