From 09abdcb5e899eb0e48b9ed11e93820eac8c511e4 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 19 Nov 2015 03:04:50 +0900 Subject: negative binary format should not be masked by 10bits; ref #3025 --- mrbgems/mruby-sprintf/src/sprintf.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'mrbgems/mruby-sprintf/src/sprintf.c') diff --git a/mrbgems/mruby-sprintf/src/sprintf.c b/mrbgems/mruby-sprintf/src/sprintf.c index 28efab997..b2caa4220 100644 --- a/mrbgems/mruby-sprintf/src/sprintf.c +++ b/mrbgems/mruby-sprintf/src/sprintf.c @@ -79,10 +79,6 @@ mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base) if (base != 2) { mrb_raisef(mrb, E_ARGUMENT_ERROR, "invalid radix %S", mrb_fixnum_value(base)); } - - if (val >= (1 << 10)) - val &= 0x3ff; - if (val == 0) { return mrb_str_new_lit(mrb, "0"); } -- cgit v1.2.3