Skip to content

Commit

Permalink
negative binary format should not be masked by 10bits; ref #3025
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Nov 19, 2015
1 parent 1a9b607 commit 09abdcb
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions mrbgems/mruby-sprintf/src/sprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit 09abdcb

Please sign in to comment.