mirror of
https://github.com/iv-org/protodec.git
synced 2025-01-02 11:26:15 -05:00
Fix overflow in VarLong
This commit is contained in:
parent
496a5f34a9
commit
174a36f4ad
@ -51,10 +51,10 @@ struct VarLong
|
|||||||
|
|
||||||
def self.to_io(io : IO, value : Int64)
|
def self.to_io(io : IO, value : Int64)
|
||||||
io.write_byte 0x00 if value == 0x00
|
io.write_byte 0x00 if value == 0x00
|
||||||
value = value.to_u64
|
value = value.to_u64!
|
||||||
|
|
||||||
while value != 0
|
while value != 0
|
||||||
byte = (value & 0x7f).to_u8
|
byte = (value & 0x7f).to_u8!
|
||||||
value >>= 7
|
value >>= 7
|
||||||
|
|
||||||
if value != 0
|
if value != 0
|
||||||
|
Loading…
Reference in New Issue
Block a user