]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs/idx.c
* Bugfix : en procesar_leer_registro para tipo1 me estaba pasando 1 char
[z.facultad/75.06/emufs.git] / emufs / idx.c
index 701ba2597cdf0be3fd123c0dcaec0414045c7a18..18d4722a4af763ba88eab83b877df09e29e62320 100644 (file)
@@ -214,10 +214,12 @@ EMUFS_REG_ID *emufs_idx_get(EMUFS *emu, EMUFS_REG_ID *cant)
        count = 0;
        while (!feof(f_idx)) {
                if (fread(&reg, sizeof(EMUFS_IDX), 1, f_idx) != 1) continue;
-               count++;
                /* TODO : Verificar errores :-D */
-               tmp = realloc(tmp, count);
-               tmp[count-1] = reg.id_reg;
+               if (reg.location != EMUFS_NOT_FOUND) {
+                       count++;
+                       tmp = realloc(tmp, count);
+                       tmp[count-1] = reg.id_reg;
+               }
        }
        fclose(f_idx);