| 290 | } |
| 291 | |
| 292 | int acl_array_delete_idx(ACL_ARRAY *a, int position, void (*free_fn)(void *)) |
| 293 | { |
| 294 | int idx; |
| 295 | |
| 296 | if (position < 0 || position >= a->count) |
| 297 | return -1; |
| 298 | if (free_fn != NULL && a->items[position] != NULL) |
| 299 | free_fn(a->items[position]); |
| 300 | a->items[position] = NULL; /* sanity set to be null */ |
| 301 | |
| 302 | for (idx = position; idx < a->count - 1; idx++) |
| 303 | a->items[idx] = a->items[idx + 1]; |
| 304 | a->count--; |
| 305 | return 0; |
| 306 | } |
| 307 | |
| 308 | int acl_array_delete(ACL_ARRAY *a, int idx, void (*free_fn)(void*)) |
| 309 | { |
no test coverage detected
searching dependent graphs…