Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
samoconnor committed Jan 30, 2018
1 parent 45f4e22 commit ea13ca8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Parsers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -266,19 +266,19 @@ Return number of bytes of chunk-data.

function parse_chunk_size(bytes::AbstractVector{UInt8})::Int

chunk_size = 0
chunk_size = Int64(0)
i = 1
x = unhex[bytes[i]]
x = Int64(unhex[bytes[i]])
while x != -1
chunk_size = chunk_size * 16 + x
chunk_size = chunk_size * Int64(16) + x
if chunk_size > chunk_size_limit
throw(ParseError(:CHUNK_SIZE_EXCEEDS_LIMIT, bytes))
end
i += 1
x = unhex[bytes[i]]
x = Int64(unhex[bytes[i]])
end
if i > 1
return chunk_size
return Int(chunk_size)
end

throw(ParseError(:INVALID_CHUNK_SIZE, bytes))
Expand Down

0 comments on commit ea13ca8

Please sign in to comment.