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/ZipOut.cpp')
-rwxr-xr-xCPP/7zip/Archive/Zip/ZipOut.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/CPP/7zip/Archive/Zip/ZipOut.cpp b/CPP/7zip/Archive/Zip/ZipOut.cpp
index 0807369c..aa82143e 100755
--- a/CPP/7zip/Archive/Zip/ZipOut.cpp
+++ b/CPP/7zip/Archive/Zip/ZipOut.cpp
@@ -221,7 +221,7 @@ void COutArchive::WriteCentralHeader(const CItem &item)
WriteBytes(item.Comment, (UInt32)item.Comment.GetCapacity());
}
-void COutArchive::WriteCentralDir(const CObjectVector<CItem> &items, const CByteBuffer &comment)
+void COutArchive::WriteCentralDir(const CObjectVector<CItem> &items, const CByteBuffer *comment)
{
SeekTo(m_BasePosition);
@@ -260,10 +260,10 @@ void COutArchive::WriteCentralDir(const CObjectVector<CItem> &items, const CByte
WriteUInt16((UInt16)(items64 ? 0xFFFF: items.Size()));
WriteUInt32(cdSize64 ? 0xFFFFFFFF: (UInt32)cdSize);
WriteUInt32(cdOffset64 ? 0xFFFFFFFF: (UInt32)cdOffset);
- UInt16 commentSize = (UInt16)comment.GetCapacity();
- WriteUInt16(commentSize);
+ UInt32 commentSize = (UInt32)(comment ? comment->GetCapacity() : 0);
+ WriteUInt16((UInt16)commentSize);
if (commentSize > 0)
- WriteBytes((const Byte *)comment, commentSize);
+ WriteBytes((const Byte *)*comment, commentSize);
m_OutBuffer.FlushWithCheck();
}