diff options
Diffstat (limited to 'CPP/7zip/Archive/Deb')
-rwxr-xr-x | CPP/7zip/Archive/Deb/DebIn.cpp | 21 | ||||
-rwxr-xr-x | CPP/7zip/Archive/Deb/DebIn.h | 1 |
2 files changed, 6 insertions, 16 deletions
diff --git a/CPP/7zip/Archive/Deb/DebIn.cpp b/CPP/7zip/Archive/Deb/DebIn.cpp index c2221d12..41aaeb8a 100755 --- a/CPP/7zip/Archive/Deb/DebIn.cpp +++ b/CPP/7zip/Archive/Deb/DebIn.cpp @@ -15,22 +15,12 @@ namespace NDeb { using namespace NHeader; -HRESULT CInArchive::ReadBytes(void *data, UInt32 size, UInt32 &processedSize) -{ - RINOK(ReadStream(m_Stream, data, size, &processedSize)); - m_Position += processedSize; - return S_OK; -} - HRESULT CInArchive::Open(IInStream *inStream) { RINOK(inStream->Seek(0, STREAM_SEEK_CUR, &m_Position)); char signature[kSignatureLen]; - UInt32 processedSize; - RINOK(ReadStream(inStream, signature, kSignatureLen, &processedSize)); - m_Position += processedSize; - if (processedSize != kSignatureLen) - return S_FALSE; + RINOK(ReadStream_FALSE(inStream, signature, kSignatureLen)); + m_Position += kSignatureLen; if (memcmp(signature, kSignature, kSignatureLen) != 0) return S_FALSE; m_Stream = inStream; @@ -100,10 +90,11 @@ HRESULT CInArchive::GetNextItemReal(bool &filled, CItemEx &item) char header[NHeader::kHeaderSize]; const char *cur = header; - UInt32 processedSize; + size_t processedSize = sizeof(header); item.HeaderPosition = m_Position; - RINOK(ReadBytes(header, sizeof(header), processedSize)); - if (processedSize < sizeof(header)) + RINOK(ReadStream(m_Stream, header, &processedSize)); + m_Position += processedSize; + if (processedSize != sizeof(header)) return S_OK; char tempString[kNameSize + 1]; diff --git a/CPP/7zip/Archive/Deb/DebIn.h b/CPP/7zip/Archive/Deb/DebIn.h index c1b72b6e..7d33fa59 100755 --- a/CPP/7zip/Archive/Deb/DebIn.h +++ b/CPP/7zip/Archive/Deb/DebIn.h @@ -15,7 +15,6 @@ class CInArchive CMyComPtr<IInStream> m_Stream; UInt64 m_Position; - HRESULT ReadBytes(void *data, UInt32 size, UInt32 &processedSize); HRESULT GetNextItemReal(bool &filled, CItemEx &itemInfo); HRESULT Skeep(UInt64 numBytes); public: |