Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Archive/Zip/ZipAddCommon.cpp')
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipAddCommon.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
index 3451e3f1..ae75a1a2 100755
--- a/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
+++ b/CPP/7zip/Archive/Zip/ZipAddCommon.cpp
@@ -146,6 +146,7 @@ HRESULT CAddCommon::Compress(
opRes.ExtractVersion = NFileHeader::NCompressionMethod::kExtractVersion_Default;
if (inCrcStreamSpec != 0)
RINOK(inCrcStreamSpec->Seek(0, STREAM_SEEK_SET, NULL));
+ RINOK(outStream->SetSize(0));
RINOK(outStream->Seek(0, STREAM_SEEK_SET, NULL));
if (_options.PasswordIsDefined)
{
@@ -218,7 +219,7 @@ HRESULT CAddCommon::Compress(
_options.Algo,
_options.DicSize,
_options.NumFastBytes,
- (BSTR)(const wchar_t *)_options.MatchFinder,
+ const_cast<BSTR>((const wchar_t *)_options.MatchFinder),
_options.NumMatchFinderCycles
};
PROPID propIDs[] =
@@ -373,7 +374,7 @@ HRESULT CAddCommon::Compress(
RINOK(outStream->Seek(0, STREAM_SEEK_CUR, &opRes.PackSize));
}
opRes.Method = method;
- return outStream->SetSize(opRes.PackSize);
+ return S_OK;
}
}}