X-Git-Url: http://pileus.org/git/?p=aweather;a=blobdiff_plain;f=src%2Flevel2.c;h=ecc39f3043d12b2ff2713a62f1770d21cebef5c1;hp=39e95225245018f430aca4d632f2c0e361727951;hb=3ec6b69dcc3bad3fce1a22e3c6b9572d83667fdf;hpb=363fdc98af5b3d47698d33e5eb1528ebf7abdcdc diff --git a/src/level2.c b/src/level2.c index 39e9522..ecc39f3 100644 --- a/src/level2.c +++ b/src/level2.c @@ -2,6 +2,8 @@ /* * TODO: ARGG, the packet sizses are all wrong.. * Check sizes of decompressed bzip files + * Split things back up to seperate files + * The second bzip contains different size packets? */ #include @@ -81,10 +83,12 @@ level2_packet_t *level2_decompress(char *raw_data, int *num_packets) data = realloc(data, data_size + cur_data_size); status = BZ2_bzBuffToBuffDecompress(data + data_size, &cur_data_size, bz2, bz2_size, 0, 0); } + if (status != BZ_OK) + error(1, 1, "Error decompressing data"); data_size += cur_data_size; // Add current chunk to decompressed data /* Debug */ - //printf("data_size = %d, cur_data_size = %d\n", data_size, cur_data_size); + printf("data_size = %d, cur_data_size = %d\n", data_size, cur_data_size); } data = realloc(data, data_size); // free unused space at the end