set the correct length for s.data when data truely increased
This commit is contained in:
parent
f9b2f9565c
commit
758a883cc6
1 changed files with 2 additions and 2 deletions
|
|
@ -226,8 +226,8 @@ proc ssWriteData(s: Stream, buffer: pointer, bufLen: int) =
|
|||
var s = StringStream(s)
|
||||
if bufLen <= 0:
|
||||
return
|
||||
if s.pos + bufLen > s.data.len():
|
||||
setLen(s.data, s.data.len + bufLen)
|
||||
if s.pos + bufLen > s.data.len:
|
||||
setLen(s.data, s.pos + bufLen)
|
||||
copyMem(addr(s.data[s.pos]), buffer, bufLen)
|
||||
inc(s.pos, bufLen)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue