commit - 6b4a60c57f8fa6f193f2c277959a31f069fa3c07
commit + 126ee0608bd8017ef807797e24616f07bfe7936c
blob - 58a2acc48d6864ff1794e447ef7614eec0fbf383
blob + 17771727f543eca5683a8c29ee19cc0995a32321
--- lib/object.c
+++ lib/object.c
i = 0;
totlen = 0;
do {
- err = got_inflate_read(&zb, f, NULL, &outlen);
+ err = got_inflate_read(&zb, f, &outlen);
if (err)
goto done;
if (strchr(zb.outbuf, '\0') == NULL) {
if (err)
return err;
- err = got_inflate_read(&zb, f, NULL, &len);
+ err = got_inflate_read(&zb, f, &len);
if (err)
return err;
if (err)
return err;
- err = got_inflate_read(&zb, f, NULL, &len);
+ err = got_inflate_read(&zb, f, &len);
if (err)
return err;
const struct got_error *
got_object_blob_read_block(struct got_blob_object *blob, size_t *outlenp)
{
- return got_inflate_read(&blob->zb, blob->f, NULL, outlenp);
+ return got_inflate_read(&blob->zb, blob->f, outlenp);
}
blob - 6a15f3dec5ce92862619f26568e884a6758ad2cc
blob + b5e809e20fd40238578c8c4f0a104cd9d376fa10
--- lib/zb.c
+++ lib/zb.c
}
const struct got_error *
-got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *inlenp,
- size_t *outlenp)
+got_inflate_read(struct got_zstream_buf *zb, FILE *f, size_t *outlenp)
{
size_t last_total_out = zb->z.total_out;
z_stream *z = &zb->z;
z->avail_out = zb->outlen;
*outlenp = 0;
- if (inlenp)
- *inlenp = 0;
do {
if (z->avail_in == 0) {
size_t n = fread(zb->inbuf, 1, zb->inlen, f);
}
z->next_in = zb->inbuf;
z->avail_in = n;
- if (inlenp)
- *inlenp += n;
}
ret = inflate(z, Z_SYNC_FLUSH);
} while (ret == Z_OK && z->avail_out > 0);
*outlen = 0;
do {
- err = got_inflate_read(&zb, f, NULL, &avail);
+ err = got_inflate_read(&zb, f, &avail);
if (err)
return err;
if (avail > 0) {
*outlen = 0;
do {
- err = got_inflate_read(&zb, infile, NULL, &avail);
+ err = got_inflate_read(&zb, infile, &avail);
if (err)
return err;
if (avail > 0) {
blob - e5294017e24d1cec6c532ded4529d174d7b65155
blob + 0796cc6d464990c0391e413c8aff1f8988c4796b
--- lib/zb.h
+++ lib/zb.h
const struct got_error *got_inflate_init(struct got_zstream_buf *, size_t);
const struct got_error *got_inflate_read(struct got_zstream_buf *, FILE *,
- size_t *, size_t *);
+ size_t *);
void got_inflate_end(struct got_zstream_buf *);
const struct got_error *got_inflate_to_mem(uint8_t **, size_t *, FILE *);
const struct got_error *got_inflate_to_file(size_t *, FILE *, FILE *);