Zero length byte sequences are fine
This commit is contained in:
parent
53981fd70a
commit
c915accf7d
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "20230913"
|
version = "20230914"
|
||||||
author = "Emery Hemingway"
|
author = "Emery Hemingway"
|
||||||
description = "data model and serialization format"
|
description = "data model and serialization format"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
|
|
@ -674,8 +674,6 @@ proc decodePreserves*(s: Stream; E = void): Preserve[E] =
|
||||||
let n = s.readData(addr data[0], data.len)
|
let n = s.readData(addr data[0], data.len)
|
||||||
if n != data.len:
|
if n != data.len:
|
||||||
raise newException(IOError, "short read")
|
raise newException(IOError, "short read")
|
||||||
else:
|
|
||||||
raiseAssert "readVarint returned zero"
|
|
||||||
result = Preserve[E](kind: pkByteString, bytes: data)
|
result = Preserve[E](kind: pkByteString, bytes: data)
|
||||||
of 0xb3:
|
of 0xb3:
|
||||||
var data = newString(s.readVarint())
|
var data = newString(s.readVarint())
|
||||||
|
|
Loading…
Reference in New Issue