X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/4fbbdce8870aa51feec002671eb0035710d072a8..9e5f9df91ca96fb4cf179841cea17c9b4fb0f99c:/src/jacu.c diff --git a/src/jacu.c b/src/jacu.c index 8c6a210..8e74812 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -2,6 +2,7 @@ #include "statichuff/statichuff.h" #include "blocksorting/bs.h" #include "mtf/mtf.h" +#include "vfile/vfile.h" #include #include #include @@ -60,7 +61,8 @@ int main(int argc, char* argv[]) int *mtf; char *salida, *data, c; data = malloc(sizeof(char)*pagesize); - salida = malloc(sizeof(char)*(pagesize)); + /* Reservo lugar tambien para guardar el k */ + salida = malloc(sizeof(char)*(pagesize)+sizeof(unsigned long int)*2); bs = bs_create(pagesize); fp = fopen(argv[optind], "rb"); fp_out = fopen("tmp.comp", "wb"); @@ -76,14 +78,14 @@ int main(int argc, char* argv[]) /* Hago el BS */ bs_solve(data, salida, bs, &k, i); /* Le aplico el MTF */ - mtf = jacu_mtf(salida, i); + mtf = jacu_mtf(salida, i+sizeof(unsigned long int)*2); for(j=0; j