aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAlexander Tkachev2016-05-25 15:55:06 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commitd014b5bf3826d78de269891ccf6722e58d7a5bcd (patch)
tree4ad978e0de9bf5ca90a8376dc3926b5c0550205d /common
parent5e346ea6fbcd4a028bc7dd63efd09ff42770f8ef (diff)
downloadscummvm-rg350-d014b5bf3826d78de269891ccf6722e58d7a5bcd.tar.gz
scummvm-rg350-d014b5bf3826d78de269891ccf6722e58d7a5bcd.tar.bz2
scummvm-rg350-d014b5bf3826d78de269891ccf6722e58d7a5bcd.zip
CLOUD: Fix MemoryReadWriteStream
There was a problem with file downloading in MinGW. Strangely, there is no such problem in Visual Studio, yet this fixes the problem.
Diffstat (limited to 'common')
-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;