mirror of
https://github.com/iv-org/protodec.git
synced 2025-07-09 08:29:33 -04:00
Fix overflow in VarLong
This commit is contained in:
parent
496a5f34a9
commit
174a36f4ad
1 changed files with 2 additions and 2 deletions
|
@ -51,10 +51,10 @@ struct VarLong
|
|||
|
||||
def self.to_io(io : IO, value : Int64)
|
||||
io.write_byte 0x00 if value == 0x00
|
||||
value = value.to_u64
|
||||
value = value.to_u64!
|
||||
|
||||
while value != 0
|
||||
byte = (value & 0x7f).to_u8
|
||||
byte = (value & 0x7f).to_u8!
|
||||
value >>= 7
|
||||
|
||||
if value != 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue