Skip to content

Instantly share code, notes, and snippets.

@epicfaace
Created May 16, 2021 20:08
Show Gist options
  • Save epicfaace/bd909b298e0c5e6fd06d5b1d46ecef22 to your computer and use it in GitHub Desktop.
Save epicfaace/bd909b298e0c5e6fd06d5b1d46ecef22 to your computer and use it in GitHub Desktop.
igzip
// When gzip files are padded with null bytes at the end (for example,
// bsdtar does this when outputting a .tar.gz to stdout), we should
// just read past the null bytes.
while (strm->avail_in >= 1 && *(strm->next_in) == '\0') {
// printf("\tlarger %d, avail_in %u, total_in %u, next_in %p - %u\n", (uint64_t) ftell_(index->fd, index->f) >= index->compressed_size ? 1 : 0, strm->avail_in, strm->total_in, strm->next_in, *(strm->next_in));
strm->next_in++;
strm->avail_in--;
}
@epicfaace
Copy link
Author

printf("\tall_null_bytes %d, avail_in %u, total_in %u, next_in %p - %u %u %u %u %u\n", all_null_bytes, strm->avail_in, strm->total_in, strm->next_in, *(strm->next_in), *(strm->next_in + 1), *(strm->next_in + 2), *(strm->next_in + 3), *(strm->next_in + 4));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment