X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/51536b1a336fbdc9be86f84f1de2ce01f243969d..7c4ffe61bc88d99fe6dd9da2c07c1a5de559b833:/emufs_gui/facturas.c diff --git a/emufs_gui/facturas.c b/emufs_gui/facturas.c index 9f5bcfd..254e35e 100644 --- a/emufs_gui/facturas.c +++ b/emufs_gui/facturas.c @@ -97,8 +97,10 @@ t_Item *leer_items(xmlNode *node, int *cant, int size) prop = xml_get_prop(node, "NroArtículo"); tmp[count-1].numero = atoi(prop); xmlFree(prop); - strcpy(tmp[count-1].cv, prop = xml_get_prop(node, "CV")); xmlFree(prop); - strcpy(tmp[count-1].pvu, prop = xml_get_prop(node, "PVU")); xmlFree(prop); + strncpy(tmp[count-1].cv, prop = xml_get_prop(node, "CV"), 8); xmlFree(prop); + tmp[count-1].cv[8] = '\0'; + strncpy(tmp[count-1].pvu, prop = xml_get_prop(node, "PVU"), 8); xmlFree(prop); + tmp[count-1].pvu[8] = '\0'; } } node = node->next; @@ -118,8 +120,10 @@ t_Item *leer_items(xmlNode *node, int *cant, int size) prop = xml_get_prop(node, "NroArtículo"); tmp[count].numero = atoi(prop); xmlFree(prop); - strcpy(tmp[count].cv, prop = xml_get_prop(node, "CV")); xmlFree(prop); - strcpy(tmp[count].pvu, prop = xml_get_prop(node, "PVU")); xmlFree(prop); + strncpy(tmp[count].cv, prop = xml_get_prop(node, "CV"), 8); xmlFree(prop); + tmp[count-1].cv[8] = '\0'; + strncpy(tmp[count].pvu, prop = xml_get_prop(node, "PVU"), 8); xmlFree(prop); + tmp[count-1].pvu[8] = '\0'; count++; } } @@ -205,7 +209,11 @@ t_LstFacturas *fact_cargar(const char *filename, int tipo, int tam_bloque, int t cant_items = 0; } tmp->fp = emufs_crear("facturas", tipo-1, tam_bloque, sizeof(t_Factura)-sizeof(char *)-sizeof(t_Item*)+cant_items*sizeof(t_Item)); - tmp->fp_texto = emufs_crear("notas", tipo_nota, bloque_nota, 100); +#ifdef DEBUG + fprintf(stderr, "Facturas : Tipo=%d Tam Bloque = %d\n", tipo-1, tam_bloque); + fprintf(stderr, "Notas : Tipo=%d Tam Bloque = %d\n", tipo_nota-1, bloque_nota); +#endif + tmp->fp_texto = emufs_crear("notas", tipo_nota-1, bloque_nota, 100); for (node=inicio ; node ; node = node->next) { if (node->type == XML_ELEMENT_NODE) { if (strcmp(node->name, "FACTURA") == 0) {