set the correct length for s.data when data truely increased

This commit is contained in:
Archs
2015-03-04 00:28:18 +08:00
parent f9b2f9565c
commit 758a883cc6

View File

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