]> git.llucax.com Git - z.facultad/75.06/emufs.git/blobdiff - emufs_gui/facturas.c
Se pone bien la memoria en cero para la GUI en borrar_registro.
[z.facultad/75.06/emufs.git] / emufs_gui / facturas.c
index e728bec135512bf7afa7a415237c31c4da7bd301..254e35eadba38d0ab2d8e785d8bf0df613d98779 100644 (file)
@@ -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++;
                                }
                        }