diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-05-26 23:53:16 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2020-05-26 23:53:16 +0900 |
| commit | 15c63688e3f1a3c6067e6af70e3e9bf999d91389 (patch) | |
| tree | a7861c86dcb6601e95a6982e8b17ed6f334952c8 /mrbgems/mruby-sprintf | |
| parent | 69c62415c07698d45e68ad2384a5204baf9e5f4d (diff) | |
| download | mruby-15c63688e3f1a3c6067e6af70e3e9bf999d91389.tar.gz mruby-15c63688e3f1a3c6067e6af70e3e9bf999d91389.zip | |
Integer format can be bigger than `32` on 64bit platforms.
We made it `64` which should be big enough:
- Format modifier: 4 characters max
- Maximum width: 19 digits max
- Period between width and precision: 1 character
- Maximum precision: 19 digits max
- Format specifier: 1 character
- NUL terminator: 1 byte
- Total: 45 < 64
Diffstat (limited to 'mrbgems/mruby-sprintf')
| -rw-r--r-- | mrbgems/mruby-sprintf/src/sprintf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c index 37f446711..4ad3a34a5 100644 --- a/mrbgems/mruby-sprintf/src/sprintf.c +++ b/mrbgems/mruby-sprintf/src/sprintf.c @@ -1041,7 +1041,7 @@ retry: mrb_value val = GETARG(); double fval; mrb_int need = 6; - char fbuf[32]; + char fbuf[64]; fval = mrb_float(mrb_Float(mrb, val)); if (!isfinite(fval)) { |
