From 5e7ab29517bd7d599ef687353ca2422d0061a517 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 30 Apr 2023 03:58:24 -0400 Subject: gzip: Fix write buffer --- (limited to 'src') diff --git a/src/gzip.c b/src/gzip.c index 9e8edfa..fbd40ef 100644 --- a/src/gzip.c +++ b/src/gzip.c @@ -187,6 +187,8 @@ opkg_opk_gzip_write(struct opkg_opk_gzip *gzip, void *record, size_t size, gzip->stream.avail_in = size; do { + gzip->stream.next_out = gzip->buffer; + gzip->stream.avail_out = gzip->buffer_size; switch (deflate(&gzip->stream, (last > 0 ? Z_FINISH : Z_NO_FLUSH))) { case Z_OK: @@ -201,8 +203,6 @@ opkg_opk_gzip_write(struct opkg_opk_gzip *gzip, void *record, size_t size, gzip->buffer_size - gzip->stream.avail_out)) { case OPKG_OPK_OK: - gzip->stream.next_out = gzip->buffer; - gzip->stream.avail_out = gzip->buffer_size; break; case OPKG_OPK_END: case OPKG_OPK_ERROR: -- cgit v0.9.1