fprintf(stderr, "BLOQUES Y REGISTROS\n");
strcpy(name_f_block_free,emu->nombre);
strcat(name_f_block_free,".idx");
+ f_block_free = fopen(name_f_block_free, "r");
{
EMUFS_IDX r;
- f_block_free = fopen(name_f_block_free, "r");
- fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
while (!feof(f_block_free)) {
+ if (fread(&r, sizeof(EMUFS_IDX), 1, f_block_free) != 1) continue;
fprintf(stderr, "ID %li en bloque %li\n", r.id_reg, r.location);
- fread(&r, sizeof(EMUFS_IDX), 1, f_block_free);
}
- fclose(f_block_free);
}
-
+ fclose(f_block_free);
return 0;
}