summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-sprintf
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2020-08-27 09:42:26 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2020-10-12 18:20:05 +0900
commit5134031e189e1cdde198e1c09f7b1d22bf2a1ce0 (patch)
treec6f9ad2f670c7aa50690f073a6e756f568cbcf00 /mrbgems/mruby-sprintf
parentbefcbd5607a060e5e619cae7333512c8bdde32f6 (diff)
downloadmruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.tar.gz
mruby-5134031e189e1cdde198e1c09f7b1d22bf2a1ce0.zip
Use `mrb_int_value()` instead of `mrb_fixnum_value()`.
Where fixnum overflow can happen.
Diffstat (limited to 'mrbgems/mruby-sprintf')
-rw-r--r--mrbgems/mruby-sprintf/src/sprintf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c
index 9ac8a512d..189b54b5c 100644
--- a/mrbgems/mruby-sprintf/src/sprintf.c
+++ b/mrbgems/mruby-sprintf/src/sprintf.c
@@ -938,10 +938,10 @@ retry:
s = nbuf;
if (v < 0) {
dots = 1;
- val = mrb_fix2binstr(mrb, mrb_fixnum_value(v), base);
+ val = mrb_fix2binstr(mrb, mrb_int_value(mrb, v), base);
}
else {
- val = mrb_fixnum_to_str(mrb, mrb_fixnum_value(v), base);
+ val = mrb_fixnum_to_str(mrb, mrb_int_value(mrb, v), base);
}
strncpy(++s, RSTRING_PTR(val), sizeof(nbuf)-2);
if (v < 0) {