X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/4fbbdce8870aa51feec002671eb0035710d072a8..0aa658449bef68a63ecc6ba2960f93810a8a8341:/src/jacu.c?ds=inline diff --git a/src/jacu.c b/src/jacu.c index 8c6a210..2982b0f 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)); 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)); for(j=0; j