aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/memstream.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/common/memstream.h b/common/memstream.h
index 963637cb27..76fa07cd24 100644
--- a/common/memstream.h
+++ b/common/memstream.h
@@ -234,12 +234,12 @@ private:
// Copy old data
if (_readPos < _writePos) {
memcpy(_data, old_data + _readPos, _writePos - _readPos);
- _writePos -= _readPos;
+ _writePos = _length;
_readPos = 0;
} else {
memcpy(_data, old_data + _readPos, oldCapacity - _readPos);
memcpy(_data + oldCapacity - _readPos, old_data, _writePos);
- _writePos += oldCapacity - _readPos;
+ _writePos = _length;
_readPos = 0;
}
free(old_data);
@@ -270,7 +270,7 @@ public:
return dataSize;
}
- uint32 read(void *dataPtr, uint32 dataSize) {
+ virtual uint32 read(void *dataPtr, uint32 dataSize) {
uint32 length = _length;
if (length < dataSize) dataSize = length;
if (dataSize == 0 || _capacity == 0) return 0;