Skip to content

Commit dfb73f9

Browse files
committed
tree schema UPDATE terminate enabled features with NULL
So that the array has the same format as arrays of features in the API.
1 parent 153fc6a commit dfb73f9

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/schema_compile.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1730,6 +1730,10 @@ lys_compile_enabled_features(struct lys_module *mod)
17301730
}
17311731
}
17321732

1733+
/* last NULL feature */
1734+
LY_ARRAY_NEW_GOTO(mod->ctx, mod->compiled->features, feat_p, rc, cleanup);
1735+
LY_ARRAY_DECREMENT(mod->compiled->features);
1736+
17331737
cleanup:
17341738
return rc;
17351739
}

src/tree_schema.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,8 @@ struct lysc_submodule {
17501750
struct lysc_module {
17511751
struct lys_module *mod; /**< covering module structure */
17521752

1753-
const char **features; /**< array of all the enabled features ([sized array](@ref sizedarrays)) */
1753+
const char **features; /**< array of all the enabled features ([sized array](@ref sizedarrays)), but
1754+
also terminated by NULL */
17541755
struct lysc_node *data; /**< list of module's top-level data nodes (linked list) */
17551756
struct lysc_node_action *rpcs; /**< first of actions nodes (linked list) */
17561757
struct lysc_node_notif *notifs; /**< first of notifications nodes (linked list) */

0 commit comments

Comments
 (0)