diff --git a/Zip/src/AutoDetectStream.cpp b/Zip/src/AutoDetectStream.cpp index de0b6705f..aaf536c55 100644 --- a/Zip/src/AutoDetectStream.cpp +++ b/Zip/src/AutoDetectStream.cpp @@ -99,8 +99,15 @@ int AutoDetectStreamBuf::readFromDevice(char* buffer, std::streamsize length) { buffer[offset++] = ZipDataInfo::HEADER[i]; } - _matchCnt = 0; - buffer[offset++] = static_cast(c); + if (c == ZipDataInfo::HEADER[0]) + { + _matchCnt = 1; + } + else + { + _matchCnt = 0; + buffer[offset++] = static_cast(c); + } } } else if (_matchCnt == 3)