summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buf.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/buf.c b/buf.c
index f5f27b39..906a800a 100644
--- a/buf.c
+++ b/buf.c
@@ -1305,12 +1305,11 @@ static val int_buf(val buf)
val self = lit("int-buf");
struct buf *b = buf_handle(buf, self);
ucnum size = c_unum(b->len, self);
- ucnum bits = size * 8;
val ubn = make_bignum();
mp_err mpe = mp_read_unsigned_bin(mp(ubn), b->data, size);
if (mpe != MP_OKAY)
do_mp_error(self, mpe);
- return sign_extend(normalize(ubn), unum(bits));
+ return sign_extend(normalize(ubn), mul(b->len, num_fast(8)));
}
static val uint_buf(val buf)