Skip to content

Commit

Permalink
Fix unpacking str8 when enable_str=false.
Browse files Browse the repository at this point in the history
Fixes #49.
  • Loading branch information
vincentdephily committed Feb 2, 2016
1 parent 9c66897 commit a0e573c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/msgpack_unpacker.erl
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,8 @@ unpack_stream(<<16#D3, V:64/big-signed-integer-unit:1, Rest/binary>>, _) ->
unpack_stream(<<2#101:3, L:5, V:L/binary, Rest/binary>>, Opt) ->
unpack_string_or_raw(V, Opt, Rest);

unpack_stream(<<16#D9, L:8/big-unsigned-integer-unit:1, V:L/binary, Rest/binary>>,
?OPTION{enable_str=true} = _Opt) ->
{unpack_string(V), Rest};
unpack_stream(<<16#D9, L:8/big-unsigned-integer-unit:1, V:L/binary, Rest/binary>>, Opt) ->
unpack_string_or_raw(V, Opt, Rest);

unpack_stream(<<16#DA, L:16/big-unsigned-integer-unit:1, V:L/binary, Rest/binary>>, Opt) ->
unpack_string_or_raw(V, Opt, Rest);
Expand Down

0 comments on commit a0e573c

Please sign in to comment.