diff options
-rw-r--r-- | pack.c | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -944,7 +944,7 @@ hex2num(char c) #define UNPACK_1 2 static VALUE -pack_unpack_internal(VALUE str, VALUE fmt, int mode) { #define hexdigits ruby_hexdigits char *s, *send; @@ -973,8 +973,15 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode) StringValue(str); StringValue(fmt); s = RSTRING_PTR(str); - send = s + RSTRING_LEN(str); p = RSTRING_PTR(fmt); pend = p + RSTRING_LEN(fmt); @@ -1614,16 +1621,16 @@ pack_unpack_internal(VALUE str, VALUE fmt, int mode) } static VALUE -pack_unpack(rb_execution_context_t *ec, VALUE str, VALUE fmt) { int mode = rb_block_given_p() ? UNPACK_BLOCK : UNPACK_ARRAY; - return pack_unpack_internal(str, fmt, mode); } static VALUE -pack_unpack1(rb_execution_context_t *ec, VALUE str, VALUE fmt) { - return pack_unpack_internal(str, fmt, UNPACK_1); } int |