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)
|
let res = getSVarint(data.toOpenArray(), length, value)
|
||||||
else:
|
else:
|
||||||
let res = PB.getUVarint(data.toOpenArray(), length, value)
|
let res = PB.getUVarint(data.toOpenArray(), length, value)
|
||||||
data.offset += length
|
if res == VarintStatus.Success:
|
||||||
result = length
|
data.offset += length
|
||||||
return
|
result = length
|
||||||
|
return
|
||||||
# Restore offset on error
|
# Restore offset on error
|
||||||
data.offset = soffset
|
data.offset = soffset
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue