Skip to content

Commit

Permalink
Fix type of libxml2 error callback function
Browse files Browse the repository at this point in the history
Current libxml2 uses void(void *user, const xmlError *error),
previously void(void *user, xmlError *error) was used.  Switch the
function definition to the current type and add a cast to avoid
incompatible-pointer-types errors with newer compilers building
against older libxml2.
  • Loading branch information
fweimer-rh committed Jan 3, 2024
1 parent 7552a3b commit 355558c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/source/validate.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct ctxt {
char *filename;
};

static void oscap_xml_validity_handler(void *user, xmlErrorPtr error)
static void oscap_xml_validity_handler(void *user, const xmlError *error)
{
struct ctxt * context = (struct ctxt *) user;

Expand Down Expand Up @@ -111,7 +111,7 @@ static inline int oscap_validate_xml(struct oscap_source *source, const char *sc
goto cleanup;
}

xmlSchemaSetParserStructuredErrors(parser_ctxt, oscap_xml_validity_handler, &context);
xmlSchemaSetParserStructuredErrors(parser_ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);

schema = xmlSchemaParse(parser_ctxt);
if (schema == NULL) {
Expand All @@ -125,7 +125,7 @@ static inline int oscap_validate_xml(struct oscap_source *source, const char *sc
goto cleanup;
}

xmlSchemaSetValidStructuredErrors(ctxt, oscap_xml_validity_handler, &context);
xmlSchemaSetValidStructuredErrors(ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);

doc = oscap_source_get_xmlDoc(source);
if (!doc)
Expand Down

0 comments on commit 355558c

Please sign in to comment.