diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-02-26 02:14:55 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-02-26 02:14:55 +0100 |
commit | 30d740cc6accc3bd477e6bc924d5b74dad71ee6d (patch) | |
tree | 2e197791d23958258b34a3bc53cc5b0584ac7060 /pcilib/xml.c | |
parent | 3ea1907f3169e0233d3a32a7d470af3c34b6f967 (diff) | |
parent | ed7a7ff66c64cc2e164070865306e7d79652063a (diff) | |
download | pcitool-30d740cc6accc3bd477e6bc924d5b74dad71ee6d.tar.gz pcitool-30d740cc6accc3bd477e6bc924d5b74dad71ee6d.tar.bz2 pcitool-30d740cc6accc3bd477e6bc924d5b74dad71ee6d.tar.xz pcitool-30d740cc6accc3bd477e6bc924d5b74dad71ee6d.zip |
Merge of further work on Python scripting from Vasiliy Chernov
Diffstat (limited to 'pcilib/xml.c')
-rw-r--r-- | pcilib/xml.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pcilib/xml.c b/pcilib/xml.c index fd12636..b980a83 100644 --- a/pcilib/xml.c +++ b/pcilib/xml.c @@ -615,7 +615,7 @@ static int pcilib_xml_parse_value_name(pcilib_t *ctx, xmlXPathContextPtr xpath, int min_set = 0, max_set = 0; pcilib_register_value_t val; - + for (cur = node->properties; cur != NULL; cur = cur->next) { if(!cur->children) continue; if(!xmlNodeIsText(cur->children)) continue; @@ -713,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]); @@ -723,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); |