From f3ebef117254889eb4b2f828bd49508933076cf2 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Tue, 9 Jan 2024 11:00:44 +0900 Subject: [PATCH] mruby-string (chars2bytes): reduce the scope of local variables --- src/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/string.c b/src/string.c index 6441d653b..f4011756f 100644 --- a/src/string.c +++ b/src/string.c @@ -330,12 +330,12 @@ chars2bytes(mrb_value s, mrb_int off, mrb_int idx) return idx; } else { - mrb_int i, b, n; + mrb_int b = 0; const char *p = RSTRING_PTR(s) + off; const char *e = RSTRING_END(s); - for (b=i=0; p