X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/c4b24cdb8c9c9c83ad2b4cad26560b3487d15bd7..80aa04fe7756cf1670b51e01238b166d95eb43e4:/emufs_gui/articulos.c diff --git a/emufs_gui/articulos.c b/emufs_gui/articulos.c index dd4e29a..150910e 100644 --- a/emufs_gui/articulos.c +++ b/emufs_gui/articulos.c @@ -64,11 +64,11 @@ t_LstArticulos *art_cargar(const char *filename, int tipo, int tam_bloque) { xmlDocPtr document; xmlNode *node, *inicio; - int cant, error = 0, i; + int error = 0, i; EMUFS_REG_SIZE size; t_LstArticulos *tmp; lst_articulos = NULL; - EMUFS_REG_ID id; + EMUFS_REG_ID id, *indices, indices_cant; tmp = (t_LstArticulos *)malloc(sizeof(t_LstArticulos)); if (tmp == NULL) return NULL; @@ -123,18 +123,18 @@ t_LstArticulos *art_cargar(const char *filename, int tipo, int tam_bloque) } else { tmp->fp = emufs_abrir("articulos"); /* Ahora trato de recuperar la info */ - cant = emufs_idx_get_count(tmp->fp); - for(i=0; ifp, &indices_cant); + for(i=0; ifp, i); /* Leo el registro */ - save = tmp->fp->leer_registro(tmp->fp, id, &size, &error); + save = tmp->fp->leer_registro(tmp->fp, indices[i], &size, &error); if (procesar_leer_articulo(&art, save, size, tmp) == 1) { - agregar_nodo_articulo(tmp, crear_nodo_articulo(id, art.numero)); + agregar_nodo_articulo(tmp, crear_nodo_articulo(indices[i], art.numero)); free(save); } } + free(indices); } return tmp;