yang BUGFIX wrong parent in output and input statement + allocation memory in function yang_add_elem
diff --git a/src/parser_yang.c b/src/parser_yang.c
index 5afc7af..df87486 100644
--- a/src/parser_yang.c
+++ b/src/parser_yang.c
@@ -380,12 +380,12 @@
int
yang_add_elem(struct lys_node_array **node, uint32_t *size)
{
- if (!*size % LY_ARRAY_SIZE) {
+ if (!(*size % LY_ARRAY_SIZE)) {
if (!(*node = ly_realloc(*node, (*size + LY_ARRAY_SIZE) * sizeof **node))) {
LOGMEM;
return EXIT_FAILURE;
} else {
- memset(*node+*size,0,LY_ARRAY_SIZE*sizeof **node);
+ memset(*node + *size, 0, LY_ARRAY_SIZE * sizeof **node);
}
}
(*size)++;