mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
478ada3bf4
When sprintf is called with a precision larger than the double's significand width (e.g. "%.51g"), fixed_width() indexed pow10 tables out of bounds and produced a negative shift exponent. Cap the internal digit count to 18 in the %g branch, matching the existing %e and %f branches; downstream loops already zero-pad to the caller's precision so visible output is unchanged. Co-authored-by: Claude <noreply@anthropic.com>