X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/18ff567719ef1e5437bef12b937fe95686c336b5..24b28f65b96a6b8d067751e3bf6715453df781aa:/emufs_gui/articulos.c?ds=inline diff --git a/emufs_gui/articulos.c b/emufs_gui/articulos.c index b7d8ee0..f768dc2 100644 --- a/emufs_gui/articulos.c +++ b/emufs_gui/articulos.c @@ -108,12 +108,20 @@ t_LstArticulos *art_cargar(const char *filename, int tipo, int tam_bloque) fprintf(stderr, "Articulos : Tipo=%d Bloque=%d\n", tipo-1, tam_bloque); #endif tmp->fp = emufs_crear("articulos", tipo-1, tam_bloque, sizeof(t_Articulo)); + if (!tmp->fp) { + PERR("NO SE PUDO CREAR ARCHIVO ARTICULOS"); + free(tmp); + xmlFreeDoc(document); + xmlCleanupParser(); + lst_articulos = NULL; + return NULL; + } for (node=inicio ; node ; node = node->next) { if (node->type == XML_ELEMENT_NODE) { if (strcmp(node->name, "ARTICULO") == 0) { t_Articulo art; void *save; - memset(&art, '*', sizeof(t_Articulo)); + memset(&art, 0, sizeof(t_Articulo)); prop = xml_get_prop(node, "NroArtículo"); art.numero = atoi(prop); xmlFree(prop);