summaryrefslogtreecommitdiffstats
path: root/pcilib/xml.c
diff options
context:
space:
mode:
authorVasilii Chernov <vchernov@inr.ru>2016-02-26 11:01:39 +0100
committerVasilii Chernov <vchernov@inr.ru>2016-02-26 11:01:39 +0100
commit0e584d07a0776454fd5487b7d23407c0624b56c2 (patch)
tree1e00cacf2077c5004c4e151d2bf3f9dddbb1b9ea /pcilib/xml.c
parente2550e6df11558ccd6e8b95f489c0988b34347af (diff)
parent30d740cc6accc3bd477e6bc924d5b74dad71ee6d (diff)
downloadpcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.gz
pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.bz2
pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.tar.xz
pcitool-0e584d07a0776454fd5487b7d23407c0624b56c2.zip
Merge with ufo.kit.edu/csa/pcitool 357 revision
Diffstat (limited to 'pcilib/xml.c')
-rw-r--r--pcilib/xml.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/pcilib/xml.c b/pcilib/xml.c
index 0463a40..b980a83 100644
--- a/pcilib/xml.c
+++ b/pcilib/xml.c
@@ -616,8 +616,6 @@ static int pcilib_xml_parse_value_name(pcilib_t *ctx, xmlXPathContextPtr xpath,
int min_set = 0, max_set = 0;
pcilib_register_value_t val;
- memset(desc, 0, sizeof(pcilib_register_value_name_t));
-
for (cur = node->properties; cur != NULL; cur = cur->next) {
if(!cur->children) continue;
if(!xmlNodeIsText(cur->children)) continue;
@@ -715,7 +713,7 @@ static int pcilib_xml_create_enum_view(pcilib_t *ctx, xmlXPathContextPtr xpath,
pcilib_error("No names is defined for enum view (%s)", desc.base.name);
return PCILIB_ERROR_INVALID_DATA;
}
-
+ memset(desc.names, 0, (nodeset->nodeNr + 1) * sizeof(pcilib_register_value_name_t));
for (i = 0; i < nodeset->nodeNr; i++) {
err = pcilib_xml_parse_value_name(ctx, xpath, doc, nodeset->nodeTab[i], &desc.names[i]);
@@ -725,11 +723,9 @@ static int pcilib_xml_create_enum_view(pcilib_t *ctx, xmlXPathContextPtr xpath,
return err;
}
}
- memset(&desc.names[nodeset->nodeNr], 0, sizeof(pcilib_register_value_name_t));
xmlXPathFreeObject(nodes);
-
err = pcilib_add_views_custom(ctx, 1, (pcilib_view_description_t*)&desc, &view_ctx);
if (err) {
free(desc.names);