X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/af65279c5092544998a7a07b364d021bc8d01908..ade05bc64de4853d99cdc1ea2657845728614f03:/src/jacu.c?ds=sidebyside diff --git a/src/jacu.c b/src/jacu.c index d0deb90..ca93ae6 100644 --- a/src/jacu.c +++ b/src/jacu.c @@ -102,33 +102,42 @@ int main(int argc, char* argv[]) fp = fopen(argv[optind], "rb"); fp_out = fopen("tmp.comp", "wb"); - c = fgetc(fp); + /*c = fgetc(fp);*/ total = 0; while (!feof(fp)) { i = 0; while ((!feof(fp)) && (i < pagesize)) { - data[i++] = c; - c = fgetc(fp); + data[i++] = fgetc(fp); total++; } + /* Saco un EOF que lee de mas */ + if (i 0) { + printf("PageSize = %ld\n", block_size); + fread(&z_len, sizeof(int), 1, fp_in); + z = malloc(sizeof(char)*z_len); + fread(z, z_len, sizeof(char), fp_in); + + /*printf("MTF Z (len=%d) = [", z_len); + { + int ii; + for(ii=0; ii