From: Ricardo Markiewicz Date: Sun, 18 Apr 2004 05:10:05 +0000 (+0000) Subject: * Pocos cambios. X-Git-Tag: svn_import_r684~381 X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/commitdiff_plain/5a387a8b34609840f1e86a5fc4af8ef47cee8fdd?ds=sidebyside * Pocos cambios. --- diff --git a/emufs_gui/facturas.c b/emufs_gui/facturas.c index 1ad3e5d..286ddc3 100644 --- a/emufs_gui/facturas.c +++ b/emufs_gui/facturas.c @@ -91,7 +91,7 @@ t_Item *leer_items(xmlNode *node, int *cant, int size) if (strcmp(node->name, "ITEMVENTA") == 0) { count++; tmp = realloc(tmp, sizeof(t_Item)*count); - memset(&tmp[count-1], '*', sizeof(t_Item)); + memset(&tmp[count-1], 0, sizeof(t_Item)); prop = xml_get_prop(node, "NroArtículo"); tmp[count-1].numero = atoi(prop); xmlFree(prop); @@ -174,6 +174,7 @@ t_LstFacturas *fact_cargar(const char *filename, int tipo, int tam_bloque) PERR("Voy a cargar de un XML"); document = xmlReadFile(filename, "ISO-8859-1",0); if (document == NULL) { + PERR("Error al leer documento!!"); free(tmp); lst_facturas = NULL; return NULL; @@ -292,6 +293,7 @@ int fact_liberar(t_LstFacturas *l) if (l == NULL) return 1; emufs_destruir(l->fp); + emufs_destruir(l->fp_texto); while (l->primero) { del = l->primero; l->primero = l->primero->sig; @@ -541,6 +543,7 @@ void fact_agregar(char *s) mvwaddstr(win, 15, 2, "Numero"); mvwaddstr(win, 15, 11, "CV"); mvwaddstr(win, 15, 21, "PVU"); + cant = 0; do { form_set_valor(form, "Nro de Articulo (* == fin)", ""); form_set_valor(form, "CV", ""); @@ -562,9 +565,11 @@ void fact_agregar(char *s) /* Agrego el Item */ cant++; its = (t_Item *)realloc(its, cant*sizeof(t_Item)); - its[cant-1].numero = atoi(entrada); - strcpy(its[cant-1].cv, form_obtener_valor_char(form, "CV")); - strcpy(its[cant-1].pvu, form_obtener_valor_char(form, "PVU")); + if (its != NULL) { + its[cant-1].numero = atoi(entrada); + strcpy(its[cant-1].cv, form_obtener_valor_char(form, "CV")); + strcpy(its[cant-1].pvu, form_obtener_valor_char(form, "PVU")); + } } } while (entrada[0] != '*');