Skip to content

Commit 5431b85

Browse files
committed
xml printer BUGFIX support for printing empty lyb anydata
Refs CESNET/netopeer2#538
1 parent 14700ec commit 5431b85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/printer_xml.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,10 @@ xml_print_anydata(struct lyout *out, int level, const struct lyd_node *node, int
570570
} else {
571571
if (any->value_type == LYD_ANYDATA_LYB) {
572572
/* parse into a data tree */
573+
ly_errno = 0;
573574
iter = lyd_parse_mem(node->schema->module->ctx, any->value.mem, LYD_LYB, LYD_OPT_DATA | LYD_OPT_STRICT
574575
| LYD_OPT_TRUSTED);
575-
if (iter) {
576+
if (!ly_errno) {
576577
/* successfully parsed */
577578
free(any->value.mem);
578579
any->value_type = LYD_ANYDATA_DATATREE;

0 commit comments

Comments
 (0)