Skip to content

Commit fb221a8

Browse files
author
Yuki Ito
committed
Fix int definition
1 parent 4cab65d commit fb221a8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/msgpack_packer.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,13 +98,13 @@ pack(Other, _) ->
9898
pack_int(N) when N >= -32->
9999
<< 2#111:3, N:5 >>;
100100
%% int 8
101-
pack_int(N) when N > -128 ->
101+
pack_int(N) when N >= -128 ->
102102
<< 16#D0:8, N:8/big-signed-integer-unit:1 >>;
103103
%% int 16
104-
pack_int(N) when N > -32768 ->
104+
pack_int(N) when N >= -16#8000 ->
105105
<< 16#D1:8, N:16/big-signed-integer-unit:1 >>;
106106
%% int 32
107-
pack_int(N) when (N band 16#FFFFFFFF) =:= N ->
107+
pack_int(N) when N >= -16#80000000 ->
108108
<< 16#D2:8, N:32/big-signed-integer-unit:1 >>;
109109
%% int 64
110110
pack_int(N) when N >= -16#8000000000000000 ->

0 commit comments

Comments
 (0)