X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/32feb1e82b00d6c1ad3f5aa6884d003a665ea975..776f9530188a0313c258614b58f0b54eb2c99c56:/emufs/idx.c?ds=sidebyside diff --git a/emufs/idx.c b/emufs/idx.c index 565cd3f..35a01f0 100644 --- a/emufs/idx.c +++ b/emufs/idx.c @@ -86,6 +86,7 @@ EMUFS_REG_ID emufs_idx_buscar_mayor_id_libre(EMUFS* emu, int* err) while (!feof(f_idx)) { /* Me aseguro de leer la cantidad de bytes correcta */ if (fread(®, sizeof(EMUFS_IDX), 1, f_idx) != 1) { + if (feof(f_idx)) break; /* No leyĆ³ por EOF */ PERR("Error al leer registros de idx"); *err = 3; /* EMUFS_ERROR_FILE_READ */ return EMUFS_NOT_FOUND; @@ -97,7 +98,7 @@ EMUFS_REG_ID emufs_idx_buscar_mayor_id_libre(EMUFS* emu, int* err) } fclose(f_idx); - if (b_found) { + if (found) { return ++max; } else { return 0;