diff options
Diffstat (limited to 'libcnary/node_list.c')
| -rw-r--r-- | libcnary/node_list.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcnary/node_list.c b/libcnary/node_list.c index 78f450e..5b291e7 100644 --- a/libcnary/node_list.c +++ b/libcnary/node_list.c | |||
| @@ -124,6 +124,7 @@ int node_list_remove(node_list_t* list, node_t* node) { | |||
| 124 | if (!list || !node) return -1; | 124 | if (!list || !node) return -1; |
| 125 | if (list->count == 0) return -1; | 125 | if (list->count == 0) return -1; |
| 126 | 126 | ||
| 127 | int index = 0; | ||
| 127 | node_t* n; | 128 | node_t* n; |
| 128 | for (n = list->begin; n; n = n->next) { | 129 | for (n = list->begin; n; n = n->next) { |
| 129 | if (node == n) { | 130 | if (node == n) { |
| @@ -144,8 +145,9 @@ int node_list_remove(node_list_t* list, node_t* node) { | |||
| 144 | list->begin = newnode; | 145 | list->begin = newnode; |
| 145 | } | 146 | } |
| 146 | list->count--; | 147 | list->count--; |
| 147 | return 0; | 148 | return index; |
| 148 | } | 149 | } |
| 150 | index++; | ||
| 149 | } | 151 | } |
| 150 | return -1; | 152 | return -1; |
| 151 | } | 153 | } |
