test/int_test.rb in bindata-2.4.8 vs test/int_test.rb in bindata-2.4.9

- old
+ new

@@ -126,10 +126,10 @@ # resulting int is guaranteed to be +ve for signed or unsigned integers (0 ... @nbytes).inject(0) { |val, i| (val << 8) | ((val + 0x11) % 0x100) } end def int_to_binary_str(val) - str = "".force_encoding(Encoding::BINARY) + str = "".dup.force_encoding(Encoding::BINARY) v = val & ((1 << (@nbytes * 8)) - 1) @nbytes.times do str.concat(v & 0xff) v >>= 8 end