Skip to content

Commit 355558c

Browse files
committed
Fix type of libxml2 error callback function
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.
1 parent 7552a3b commit 355558c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/source/validate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct ctxt {
4646
char *filename;
4747
};
4848

49-
static void oscap_xml_validity_handler(void *user, xmlErrorPtr error)
49+
static void oscap_xml_validity_handler(void *user, const xmlError *error)
5050
{
5151
struct ctxt * context = (struct ctxt *) user;
5252

@@ -111,7 +111,7 @@ static inline int oscap_validate_xml(struct oscap_source *source, const char *sc
111111
goto cleanup;
112112
}
113113

114-
xmlSchemaSetParserStructuredErrors(parser_ctxt, oscap_xml_validity_handler, &context);
114+
xmlSchemaSetParserStructuredErrors(parser_ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);
115115

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

128-
xmlSchemaSetValidStructuredErrors(ctxt, oscap_xml_validity_handler, &context);
128+
xmlSchemaSetValidStructuredErrors(ctxt, (xmlStructuredErrorFunc) oscap_xml_validity_handler, &context);
129129

130130
doc = oscap_source_get_xmlDoc(source);
131131
if (!doc)

0 commit comments

Comments
 (0)