mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-12 20:14:09 +00:00
Fix protobuf's do not check error value.
This commit is contained in:
parent
5e6d740ee7
commit
411d9f0b9c
@ -203,9 +203,10 @@ proc getVarintValue*(data: var ProtoBuffer, field: int,
|
||||
let res = getSVarint(data.toOpenArray(), length, value)
|
||||
else:
|
||||
let res = PB.getUVarint(data.toOpenArray(), length, value)
|
||||
data.offset += length
|
||||
result = length
|
||||
return
|
||||
if res == VarintStatus.Success:
|
||||
data.offset += length
|
||||
result = length
|
||||
return
|
||||
# Restore offset on error
|
||||
data.offset = soffset
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user