Permalink
Browse files

negative binary format should not be masked by 10bits; ref #3025

  • Loading branch information...
matz committed Nov 18, 2015
1 parent 1a9b607 commit 09abdcb5e899eb0e48b9ed11e93820eac8c511e4
Showing with 0 additions and 4 deletions.
  1. +0 −4 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");
}

0 comments on commit 09abdcb

Please sign in to comment.