Fix protobuf's do not check error value.

This commit is contained in:
cheatfate 2019-02-28 22:29:03 +02:00
parent 5e6d740ee7
commit 411d9f0b9c
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 4 additions and 3 deletions

View File

@ -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