diff options
author | Igor Pavlov <ipavlov@users.sourceforge.net> | 2014-12-26 03:00:00 +0300 |
---|---|---|
committer | Kornel LesiĆski <kornel@geekhood.net> | 2016-05-28 02:16:53 +0300 |
commit | 7e021179cd9f46b5bf2d48aac84783ff431dd5ac (patch) | |
tree | 0004a11d40a6a4e61bd4216ea106ce1c27ddb62a /CPP/7zip/Archive | |
parent | 0dc16c691d208c904468ba4a2779bbe3a2b4dc4b (diff) |
9.369.36
Diffstat (limited to 'CPP/7zip/Archive')
-rw-r--r-- | CPP/7zip/Archive/Common/InStreamWithCRC.cpp | 6 | ||||
-rw-r--r-- | CPP/7zip/Archive/FlvHandler.cpp | 2 | ||||
-rw-r--r-- | CPP/7zip/Archive/Rar/RarHandler.cpp | 21 |
3 files changed, 14 insertions, 15 deletions
diff --git a/CPP/7zip/Archive/Common/InStreamWithCRC.cpp b/CPP/7zip/Archive/Common/InStreamWithCRC.cpp index 3f4dd3b8..a2d68832 100644 --- a/CPP/7zip/Archive/Common/InStreamWithCRC.cpp +++ b/CPP/7zip/Archive/Common/InStreamWithCRC.cpp @@ -9,9 +9,9 @@ STDMETHODIMP CSequentialInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *p UInt32 realProcessed = 0; HRESULT result = S_OK; if (_stream) - _stream->Read(data, size, &realProcessed); + result = _stream->Read(data, size, &realProcessed); _size += realProcessed; - if (size > 0 && realProcessed == 0) + if (size != 0 && realProcessed == 0) _wasFinished = true; _crc = CrcUpdate(_crc, data, realProcessed); if (processedSize) @@ -27,7 +27,7 @@ STDMETHODIMP CInStreamWithCRC::Read(void *data, UInt32 size, UInt32 *processedSi result = _stream->Read(data, size, &realProcessed); _size += realProcessed; /* - if (size > 0 && realProcessed == 0) + if (size != 0 && realProcessed == 0) _wasFinished = true; */ _crc = CrcUpdate(_crc, data, realProcessed); diff --git a/CPP/7zip/Archive/FlvHandler.cpp b/CPP/7zip/Archive/FlvHandler.cpp index 3bb4620b..577224b2 100644 --- a/CPP/7zip/Archive/FlvHandler.cpp +++ b/CPP/7zip/Archive/FlvHandler.cpp @@ -337,7 +337,7 @@ HRESULT CHandler::Open2(IInStream *stream, IArchiveOpenCallback *callback) break; if (items.Size() >= kNumChunksMax) return S_FALSE; - Byte firstByte = buf[kTagHeaderSize]; + Byte firstByte = item.Data[kTagHeaderSize]; Byte subType, props; if (item.Type == kType_Audio) { diff --git a/CPP/7zip/Archive/Rar/RarHandler.cpp b/CPP/7zip/Archive/Rar/RarHandler.cpp index c4adee41..d54995ef 100644 --- a/CPP/7zip/Archive/Rar/RarHandler.cpp +++ b/CPP/7zip/Archive/Rar/RarHandler.cpp @@ -964,22 +964,21 @@ STDMETHODIMP CHandler::GetProperty(UInt32 index, PROPID propID, PROPVARIANT *val case kpidUnpackVer: prop = item.UnPackVersion; break; case kpidMethod: { - char temp[16]; - char *s = temp; - if (item.Method >= (Byte)'0' && item.Method <= (Byte)'5') + char s[16]; + Byte m = item.Method; + if (m < (Byte)'0' || m > (Byte)'5') + ConvertUInt32ToString(m, s); + else { - *s++ = 'm'; - *s++ = (char)item.Method; + s[0] = 'm'; + s[1] = (char)m; + s[2] = 0; if (!item.IsDir()) { - *s++ = ':'; - ConvertUInt32ToString(16 + item.GetDictSize(), s); + s[2] = ':'; + ConvertUInt32ToString(16 + item.GetDictSize(), &s[3]); } } - else - ConvertUInt32ToString(item.Method, s); - s += MyStringLen(s); - *s = 0; prop = s; break; } |