mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Should not use sizeof(buf) when buf is char*; #3701
This commit is contained in:
@@ -610,7 +610,7 @@ mrb_str_upto(mrb_state *mrb, mrb_value beg)
|
||||
|
||||
while (bi <= ei) {
|
||||
if (excl && bi == ei) break;
|
||||
snprintf(buf, sizeof(buf), "%.*d", min_width, bi);
|
||||
snprintf(buf, max_width+1, "%.*d", (int)min_width, bi);
|
||||
mrb_yield(mrb, block, mrb_str_new(mrb, buf, strlen(buf)));
|
||||
mrb_gc_arena_restore(mrb, ai);
|
||||
bi++;
|
||||
|
||||
Reference in New Issue
Block a user