}
data = malloc(sizeof(char)*len);
- salida = malloc(sizeof(char)*(len+1));
+ salida = malloc(sizeof(char)*(len+1+sizeof(unsigned long int)*2));
orig = malloc(sizeof(char)*(len+1));
salida[len] = '\0';
c = fgetc(fp);
total++;
}
+ /* lleno data mano! */
+ srand(time(NULL));
+ {
+ size_t jj;
+ for(jj=0; jj<i;jj++)
+ data[jj] = rand()%255;
+ }
bs_solve(data, salida, bs, &k, i);
/* XXX ACA SALIDA DEBERIA PASAR A LA SIGUIENTE ETAPA XXX */
if (argc == 3) {
- printf("BS : %s -> %ld\n", salida, k);
- bs_restore(orig, salida, k, i);
- printf("Orig : %s\n", orig);
+ bs_restore(orig, salida+sizeof(Uint32)*2, k, i);
} else
- fwrite(salida, 1, i, fp);
+ fwrite(salida, 1, i, stdout);
}
fclose(fp);
bs_destroy(bs);