Skip to content

Commit

Permalink
tgzip: Update for struct uzlib_comp refactor.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
  • Loading branch information
pfalcon committed Nov 14, 2021
1 parent fb9dbb1 commit 6d60d65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/tgzip/tgzip.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ int main(int argc, char *argv[])
comp.hash_table = malloc(hash_size);
memset(comp.hash_table, 0, hash_size);

zlib_start_block(&comp.out);
zlib_start_block(&comp);
uzlib_compress(&comp, source, len);
zlib_finish_block(&comp.out);
zlib_finish_block(&comp);

printf("compressed to %u raw bytes\n", comp.out.outlen);
printf("compressed to %u raw bytes\n", comp.outlen);

/* -- write output -- */

Expand All @@ -108,7 +108,7 @@ int main(int argc, char *argv[])
putc(0x04, fout); // XFL
putc(0x03, fout); // OS

fwrite(comp.out.outbuf, 1, comp.out.outlen, fout);
fwrite(comp.outbuf, 1, comp.outlen, fout);

unsigned crc = ~uzlib_crc32(source, len, ~0);
fwrite(&crc, sizeof(crc), 1, fout);
Expand Down

0 comments on commit 6d60d65

Please sign in to comment.