fprintf(stderr, "no pude abrir el archivo %s\n",name_f_block_free);
return -1;
}
+ fprintf(stderr,"BOQUES Y ESPACIO LIBRE\n");
fread(®,sizeof(reg),1,f_block_free);
while ( !feof(f_block_free) ){
- fprintf(stderr, " Bloque = %li Espacio libre = %li\n",reg.marker, reg.freespace);
+ fprintf(stderr, "Bloque = %li Espacio libre = %li\n",reg.marker, reg.freespace);
fread(®,sizeof(reg),1,f_block_free);
}
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;
}