commit - 2793759294c2ec8056c179cf87f7158101cae15d
commit + 4b57020975f73d8c07712c7d26151f50205df436
blob - b72db6aaa7fa5c47899a453ee52a55222314cd79
blob + 472aaa11edacfa2b14007043174136b80ff00ba9
--- lib/inflate.c
+++ lib/inflate.c
size_t last_total_out = zb->z.total_out;
z_stream *z = &zb->z;
int ret = Z_ERRNO;
- off_t off, consumed;
z->next_out = zb->outbuf;
z->avail_out = zb->outlen;
*outlenp = 0;
- off = ftello(f);
- consumed = 0;
do {
- size_t last_total_in = zb->z.total_in;
if (z->avail_in == 0) {
size_t n = fread(zb->inbuf, 1, zb->inlen, f);
if (n == 0) {
z->avail_in = n;
}
ret = inflate(z, Z_SYNC_FLUSH);
- consumed += z->total_in - last_total_in;
} while (ret == Z_OK && z->avail_out > 0);
if (ret == Z_OK || ret == Z_BUF_ERROR) {
}
*outlenp = z->total_out - last_total_out;
- fseek(f, off + consumed, SEEK_SET);
return NULL;
}