X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/5df9bdcff11e0a64b9c05ca5294d6edf0a62603f..3fedb806fdecbcb4508773321011e96ab27903e9:/emufs/emufs.c diff --git a/emufs/emufs.c b/emufs/emufs.c index 33c114a..297cf9d 100644 --- a/emufs/emufs.c +++ b/emufs/emufs.c @@ -278,17 +278,15 @@ int ver_archivo_FS(EMUFS *emu) 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; }