diff --git a/src/string.c b/src/string.c index 518b62ea3..e5c3a3843 100644 --- a/src/string.c +++ b/src/string.c @@ -330,16 +330,21 @@ utf8_strlen(mrb_value str) static mrb_int chars2bytes(mrb_value s, mrb_int off, mrb_int idx) { - mrb_int i, b, n; - const char *p = RSTRING_PTR(s) + off; - const char *e = RSTRING_END(s); - - for (b=i=0; p