- static t_BlockSort *array = NULL;
- static t_BlockSort *ord = NULL;
-
- if (!array) array = malloc(sizeof(t_BlockSort)*len);
- if (!ord) ord = malloc(sizeof(t_BlockSort)*len);
-
- generar_array(in, array, len);
- ordenar_array(in, array, ord, len);
- (*k) = generar_salida(in, ord, out, len);
+ unsigned int l;
+ l = bs->len;
+ /* Hack para pedasos menores a la pagina */
+ if (leido < bs->len) bs->len = leido;
+
+ generar_array(in, bs);
+ ordenar_array(in, bs);
+ (*k) = generar_salida(in, bs, out);
+
+ bs->len = l;