]> Pileus Git - aweather/blobdiff - src/level2.c
Adding tab area at the bottom for configuration
[aweather] / src / level2.c
index 39e95225245018f430aca4d632f2c0e361727951..ecc39f3043d12b2ff2713a62f1770d21cebef5c1 100644 (file)
@@ -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 <stdio.h>
@@ -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