fixed GH #1599: readFromDevice( ) in AutoDetectStream.cpp in Poco Zip cannot detect signature

This commit is contained in:
Guenter Obiltschnig 2017-02-17 09:58:02 +01:00
parent c32e683b6c
commit 820a4ed13d

View File

@ -100,10 +100,17 @@ int AutoDetectStreamBuf::readFromDevice(char* buffer, std::streamsize length)
{
buffer[offset++] = ZipDataInfo::HEADER[i];
}
if (c == ZipDataInfo::HEADER[0])
{
_matchCnt = 1;
}
else
{
_matchCnt = 0;
buffer[offset++] = static_cast<char>(c);
}
}
}
else if (_matchCnt == 3)
{
if (ZipDataInfo::HEADER[3] == c)