Skip to content

Commit dafa19d

Browse files
author
Andrew Kirilenko
committed
Proper use of null for jiffy-style encoding/decoding.
1 parent 952f85f commit dafa19d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/msgpack_packer.erl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ pack(F, _) when is_float(F) ->
3434
pack_double(F);
3535
pack(null, _Opt = ?OPTION{interface=jsx}) ->
3636
<< 16#C0:8 >>;
37+
pack(null, _Opt = ?OPTION{interface=jiffy}) ->
38+
<< 16#C0:8 >>;
3739
pack(nil, _Opt = ?OPTION{interface=Interface})
38-
when Interface =/= jsx ->
40+
when Interface =/= jsx andalso Interface =/= jiffy ->
3941
<< 16#C0:8 >>;
4042
pack(false, _) ->
4143
<< 16#C2:8 >>;

src/msgpack_unpacker.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
%% ATOMS
3636
unpack_stream(<<16#C0, Rest/binary>>, _Opt = ?OPTION{interface=jsx}) ->
3737
{null, Rest};
38+
unpack_stream(<<16#C0, Rest/binary>>, _Opt = ?OPTION{interface=jiffy}) ->
39+
{null, Rest};
3840
unpack_stream(<<16#C0, Rest/binary>>, _) ->
3941
{nil, Rest};
4042
unpack_stream(<<16#C2, Rest/binary>>, _) ->

0 commit comments

Comments
 (0)