Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
struct pakfire_parser_declaration* d = NULL;
char* namespace = NULL;
char* value = NULL;
- int r;
-
- DEBUG(parser1->ctx, "Merging parsers %p and %p\n", parser1, parser2);
+ int r = 0;
- if (!parser2) {
- errno = EINVAL;
- return 1;
- }
+ if (!parser1 || !parser2)
+ return -EINVAL;
// Do not try to merge a parser with itself
if (parser1 == parser2)
- return EINVAL;
+ return -EINVAL;
+
+ DEBUG(parser1->ctx, "Merging parsers %p and %p\n", parser1, parser2);
for (unsigned int i = 0; i < parser2->num_declarations; i++) {
d = parser2->declarations[i];