summaryrefslogtreecommitdiff
path: root/ext/-test-/bignum/pack.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/-test-/bignum/pack.c')
-rw-r--r--ext/-test-/bignum/pack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/-test-/bignum/pack.c b/ext/-test-/bignum/pack.c
index 8634e1e..62f8f62 100644
--- a/ext/-test-/bignum/pack.c
+++ b/ext/-test-/bignum/pack.c
@@ -6,17 +6,16 @@ rb_integer_pack_m(VALUE val, VALUE buf, VALUE wordsize_arg, VALUE nails, VALUE f
{
int sign;
size_t count = 0;
- void *ret;
size_t wordsize = NUM2SIZET(wordsize_arg);
StringValue(buf);
rb_str_modify(buf);
count = wordsize == 0 ? 0 : RSTRING_LEN(buf) / wordsize;
- ret = rb_integer_pack(val,
- &sign, RSTRING_PTR(buf), count,
+ sign = rb_integer_pack(val,
+ RSTRING_PTR(buf), count,
wordsize, NUM2SIZET(nails), NUM2INT(flags));
- return rb_ary_new_from_args(3, INT2NUM(sign), ret ? rb_str_new(ret, wordsize * count) : Qnil, SIZET2NUM(count));
+ return rb_ary_new_from_args(3, INT2NUM(sign), rb_str_new(RSTRING_PTR(buf), wordsize * count), SIZET2NUM(count));
}
static VALUE