Zero length byte sequences are fine

This commit is contained in:
Emery Hemingway 2023-09-14 10:29:58 +02:00
parent 53981fd70a
commit c915accf7d
2 changed files with 1 additions and 3 deletions

View File

@ -1,6 +1,6 @@
# Package
version = "20230913"
version = "20230914"
author = "Emery Hemingway"
description = "data model and serialization format"
license = "Unlicense"

View File

@ -674,8 +674,6 @@ proc decodePreserves*(s: Stream; E = void): Preserve[E] =
let n = s.readData(addr data[0], data.len)
if n != data.len:
raise newException(IOError, "short read")
else:
raiseAssert "readVarint returned zero"
result = Preserve[E](kind: pkByteString, bytes: data)
of 0xb3:
var data = newString(s.readVarint())