fixes zero length input bug in output_stream.append
This commit is contained in:
parent
1e85ab9150
commit
12250ec3ed
2 changed files with 5 additions and 0 deletions
|
|
@ -356,6 +356,7 @@ proc append*(c: var WriteCursor, bytes: openarray[byte]) {.inline.} =
|
|||
pageRemaining = c.runway
|
||||
inputLen = bytes.len
|
||||
|
||||
if inputLen == 0: return
|
||||
if inputLen <= pageRemaining:
|
||||
copyMem(c.head, unsafeAddr bytes[0], inputLen)
|
||||
c.head = shift(c.head, inputLen)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue