data tree BUGFIX lyd_new_path return value
diff --git a/src/tree_data.c b/src/tree_data.c
index 351bb9d..9f47816 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -974,20 +974,20 @@
API struct lyd_node *
lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const char *value, int options)
{
- struct lyd_node *new_node = NULL;
+ struct lyd_node *new_parent = NULL;
- lyd_new_path2(parent, ctx, path, value, 0, options, NULL, &new_node);
- return new_node;
+ lyd_new_path2(parent, ctx, path, value, 0, options, &new_parent, NULL);
+ return new_parent;
}
API struct lyd_node *
lyd_new_path_any(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const void *value,
LYD_ANYDATA_VALUETYPE value_type, int options)
{
- struct lyd_node *new_node = NULL;
+ struct lyd_node *new_parent = NULL;
- lyd_new_path2(parent, ctx, path, value, value_type, options, NULL, &new_node);
- return new_node;
+ lyd_new_path2(parent, ctx, path, value, value_type, options, &new_parent, NULL);
+ return new_parent;
}
API LY_ERR
diff --git a/src/tree_data.h b/src/tree_data.h
index 803b610..ade5b7c 100644
--- a/src/tree_data.h
+++ b/src/tree_data.h
@@ -773,7 +773,7 @@
* @param[in] path Path to create (TODO ref path).
* @param[in] value Value of the new leaf/leaf-list. For other node types, it is ignored.
* @param[in] options Bitmask of options, see @ref pathoptions.
- * @return (Last) created node.
+ * @return First created node.
* @return NULL on error.
*/
struct lyd_node *lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const char *value,
@@ -792,7 +792,7 @@
* @param[in] value Value of the new leaf/leaf-list/anyxml/anydata. For other node types, it is ignored.
* @param[in] value_type Anyxml/anydata node @p value type.
* @param[in] options Bitmask of options, see @ref pathoptions.
- * @return (Last) created node.
+ * @return First created node.
* @return NULL on error.
*/
struct lyd_node *lyd_new_path_any(struct lyd_node *parent, const struct ly_ctx *ctx, const char *path, const void *value,