mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 13:15:04 -06:00
9.34
This commit is contained in:
committed by
Kornel Lesiński
parent
83f8ddcc5b
commit
f08f4dcc3c
10
CPP/7zip/Common/OutMemStream.cpp
Executable file → Normal file
10
CPP/7zip/Common/OutMemStream.cpp
Executable file → Normal file
@@ -40,15 +40,15 @@ STDMETHODIMP COutMemStream::Write(const void *data, UInt32 size, UInt32 *process
|
||||
return OutSeqStream->Write(data, size, processedSize);
|
||||
if (processedSize != 0)
|
||||
*processedSize = 0;
|
||||
while(size != 0)
|
||||
while (size != 0)
|
||||
{
|
||||
if ((int)_curBlockIndex < Blocks.Blocks.Size())
|
||||
if (_curBlockIndex < Blocks.Blocks.Size())
|
||||
{
|
||||
Byte *p = (Byte *)Blocks.Blocks[(int)_curBlockIndex] + _curBlockPos;
|
||||
Byte *p = (Byte *)Blocks.Blocks[_curBlockIndex] + _curBlockPos;
|
||||
size_t curSize = _memManager->GetBlockSize() - _curBlockPos;
|
||||
if (size < curSize)
|
||||
curSize = size;
|
||||
memmove(p, data, curSize);
|
||||
memcpy(p, data, curSize);
|
||||
if (processedSize != 0)
|
||||
*processedSize += (UInt32)curSize;
|
||||
data = (const void *)((const Byte *)data + curSize);
|
||||
@@ -124,7 +124,7 @@ STDMETHODIMP COutMemStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPos
|
||||
}
|
||||
else
|
||||
return E_NOTIMPL;
|
||||
if (newPosition != 0)
|
||||
if (newPosition)
|
||||
*newPosition = GetPos();
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user