X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/18ff567719ef1e5437bef12b937fe95686c336b5..c8239d08a90bf0122fc54804ecee09dc14e5f826:/emufs_gui/articulos.c?ds=sidebyside 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);