diff options
| author | 2012-01-12 00:29:22 +0100 | |
|---|---|---|
| committer | 2012-01-12 00:29:22 +0100 | |
| commit | 83fa6982dfddaed93195402e2e0b7435bc707e06 (patch) | |
| tree | 8da1311265233cf5a1f468db5b4f0db39d786aab /libcnary | |
| parent | fd1dd885e29f6ba45dfd90575a210fd4139ec45c (diff) | |
| download | libplist-83fa6982dfddaed93195402e2e0b7435bc707e06.tar.gz libplist-83fa6982dfddaed93195402e2e0b7435bc707e06.tar.bz2 | |
libcnary: fix missing return value and missing variable initialization
Diffstat (limited to 'libcnary')
| -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 | } |
