X-Git-Url: https://git.llucax.com/z.facultad/75.06/jacu.git/blobdiff_plain/38539d358104fc364cd4bc900742acdefbad30ce..827a184ea907acf9b2b2d72d89ab67572728e11e:/src/blocksorting/main.c diff --git a/src/blocksorting/main.c b/src/blocksorting/main.c index e83a28a..91582a9 100644 --- a/src/blocksorting/main.c +++ b/src/blocksorting/main.c @@ -23,7 +23,7 @@ int main(int argc, char *argv[]) } 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'; @@ -40,13 +40,18 @@ int main(int argc, char *argv[]) c = fgetc(fp); total++; } + /* lleno data mano! */ + srand(time(NULL)); + { + size_t jj; + for(jj=0; jj %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, stdout); }