summaryrefslogtreecommitdiffstats
path: root/src/gzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gzip.c')
-rw-r--r--src/gzip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gzip.c b/src/gzip.c
index fbd40ef..736cbd7 100644
--- a/src/gzip.c
+++ b/src/gzip.c
@@ -38,6 +38,7 @@ struct opkg_opk_gzip {
opkg_opk_gzip_write_func *write_func;
void *user_data;
z_stream stream;
+ gz_header gz_header;
};
static struct opkg_opk_gzip *
@@ -46,7 +47,6 @@ _opkg_opk_gzip_init(enum _opkg_opk_gzip_dir dir,
opkg_opk_gzip_write_func *write_func, void *user_data)
{
struct opkg_opk_gzip *gzip;
- gz_header gz_header;
gzip = malloc(sizeof(*gzip));
if (gzip == NULL) {
@@ -79,14 +79,14 @@ _opkg_opk_gzip_init(enum _opkg_opk_gzip_dir dir,
free(gzip);
return NULL;
}
- gz_header.text = 0;
- gz_header.time = 0; /* Stored as 32-bit unsigned int */
- gz_header.os = 3; /* Unix, per RFC 1952 */
- gz_header.extra = Z_NULL;
- gz_header.name = Z_NULL;
- gz_header.comment = Z_NULL;
- gz_header.hcrc = 0;
- if (deflateSetHeader(&gzip->stream, &gz_header) != Z_OK) {
+ gzip->gz_header.text = 0;
+ gzip->gz_header.time = 0; /* Stored as 32-bit uint */
+ gzip->gz_header.os = 3; /* Unix, per RFC 1952 */
+ gzip->gz_header.extra = Z_NULL;
+ gzip->gz_header.name = Z_NULL;
+ gzip->gz_header.comment = Z_NULL;
+ gzip->gz_header.hcrc = 0;
+ if (deflateSetHeader(&gzip->stream, &gzip->gz_header) != Z_OK) {
deflateEnd(&gzip->stream);
free(gzip);
return NULL;