In the ZLIB Manual it is stated that Z_PARTIAL_FLUSH
always flush an extra 10 bits. So that we correct for that using deflatePrime
when we want to append later.
But why then is gzlog.c
containing logic to find dynamically the bit count if *buf
. According to the specs this is not needed and only the else
is needed to set it to 10?
if (*buf) {
log->back = 1;
while ((*buf & ((uint)1 << (8 - log->back++))) == 0)
; /* guaranteed to terminate, since *buf != 0 */
}
else
log->back = 10;