libyang FEATURE add lyd_get_value() and lyd_get_meta_value()
Avoid direct accessing of value's canonical member using the new
functions or (internaly) by using the type's print callback.
diff --git a/src/tree_data_hash.c b/src/tree_data_hash.c
index a27f514..b56f5b9 100644
--- a/src/tree_data_hash.c
+++ b/src/tree_data_hash.c
@@ -47,13 +47,13 @@
/* list hash is made up from its keys */
for (iter = list->child; iter && (iter->schema->flags & LYS_KEY); iter = iter->next) {
- const char *value = LYD_CANON_VALUE(iter);
+ const char *value = lyd_get_value(iter);
node->hash = dict_hash_multi(node->hash, value, strlen(value));
}
}
} else if (node->schema->nodetype == LYS_LEAFLIST) {
/* leaf-list adds its value */
- const char *value = LYD_CANON_VALUE(node);
+ const char *value = lyd_get_value(node);
node->hash = dict_hash_multi(node->hash, value, strlen(value));
}