diff options
| -rw-r--r-- | libcnary/node.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcnary/node.c b/libcnary/node.c index 1f9f669..264c78e 100644 --- a/libcnary/node.c +++ b/libcnary/node.c | |||
| @@ -104,7 +104,7 @@ int node_detach(node_t* parent, node_t* child) { | |||
| 104 | 104 | ||
| 105 | int node_insert(node_t* parent, unsigned int index, node_t* child) | 105 | int node_insert(node_t* parent, unsigned int index, node_t* child) |
| 106 | { | 106 | { |
| 107 | if (!parent || !child) return; | 107 | if (!parent || !child) return -1; |
| 108 | child->isLeaf = TRUE; | 108 | child->isLeaf = TRUE; |
| 109 | child->isRoot = FALSE; | 109 | child->isRoot = FALSE; |
| 110 | child->parent = parent; | 110 | child->parent = parent; |
| @@ -209,7 +209,7 @@ int node_child_position(struct node_t* parent, node_t* child) | |||
| 209 | node_t* node_copy_deep(node_t* node, copy_func_t copy_func) | 209 | node_t* node_copy_deep(node_t* node, copy_func_t copy_func) |
| 210 | { | 210 | { |
| 211 | if (!node) return NULL; | 211 | if (!node) return NULL; |
| 212 | void *data; | 212 | void *data = NULL; |
| 213 | if (copy_func) { | 213 | if (copy_func) { |
| 214 | data = copy_func(node->data); | 214 | data = copy_func(node->data); |
| 215 | } | 215 | } |
