X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/e8fa2ccccf10bdfcff1aedbaf919f3bc823f1ecf..0213eecd485623b3f5def829c4b16acaf4baad2e:/emufs_gui/articulos.c?ds=sidebyside diff --git a/emufs_gui/articulos.c b/emufs_gui/articulos.c index 59a3f35..7abf14d 100644 --- a/emufs_gui/articulos.c +++ b/emufs_gui/articulos.c @@ -335,8 +335,8 @@ void art_eliminar(char *s) { WINDOW *win; t_Articulo *articulo; - t_Reg_Articulo *nodo; EMUFS_REG_ID id; + CLAVE k; win = newwin(8, COLS-2, 13, 1); box(win, 0, 0); @@ -351,15 +351,8 @@ void art_eliminar(char *s) wrefresh(win); getch(); } else { - nodo = lst_articulos->primero; - while (nodo) { - if (nodo->numero == articulo->numero) { - lst_articulos->fp->borrar_registro(lst_articulos->fp, nodo->num_reg); - eliminar_nodo_articulo(lst_articulos, nodo); - break; - } - nodo = nodo->sig; - } + k = emufs_indice_generar_clave_desde_valor(lst_articulos->fp->indices, (char *)&(articulo->numero)); + lst_articulos->fp->borrar_registro(lst_articulos->fp, k); free(articulo); }