use unpack from file method that i forgot about

This commit is contained in:
Devin Acker 2013-06-05 21:32:03 -04:00
parent 640d86bc2e
commit cdb9a5edc8
2 changed files with 3 additions and 10 deletions

10
exhal.c
View file

@ -41,17 +41,11 @@ int main (int argc, char **argv) {
size_t outputsize; size_t outputsize;
uint32_t fileoffset; uint32_t fileoffset;
uint8_t unpacked[DATA_SIZE]; uint8_t unpacked[DATA_SIZE];
uint8_t packed[DATA_SIZE];
memset(packed, 0, DATA_SIZE);
fileoffset = strtol(argv[2], NULL, 0); fileoffset = strtol(argv[2], NULL, 0);
// read the file // decompress the file
fseek(infile, fileoffset, SEEK_SET); outputsize = unpack_from_file(infile, fileoffset, unpacked);
fread(packed, sizeof(uint8_t), DATA_SIZE, infile);
// compress the file
outputsize = unpack(packed, unpacked);
// write the uncompressed data to the file // write the uncompressed data to the file
fseek(infile, 0, SEEK_SET); fseek(infile, 0, SEEK_SET);

View file

@ -69,8 +69,7 @@ int main (int argc, char **argv) {
size_t inputsize, outputsize; size_t inputsize, outputsize;
uint8_t unpacked[DATA_SIZE]; uint8_t unpacked[DATA_SIZE];
uint8_t packed[DATA_SIZE]; uint8_t packed[DATA_SIZE] = {0};
memset(packed, 0, DATA_SIZE);
// check size of input file // check size of input file
fseek(infile, 0, SEEK_END); fseek(infile, 0, SEEK_END);