diff options
Diffstat (limited to 'src/ptrarray.c')
-rw-r--r-- | src/ptrarray.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ptrarray.c b/src/ptrarray.c index bcffb77..c499773 100644 --- a/src/ptrarray.c +++ b/src/ptrarray.c @@ -42,7 +42,7 @@ void ptr_array_free(ptrarray_t *pa) void ptr_array_insert(ptrarray_t *pa, void *data, long array_index) { - if (!pa || !pa->pdata || !data) return; + if (!pa || !pa->pdata) return; long remaining = pa->capacity-pa->len; if (remaining == 0) { pa->pdata = realloc(pa->pdata, sizeof(void*) * (pa->capacity + pa->capacity_step)); @@ -89,3 +89,8 @@ void* ptr_array_index(ptrarray_t *pa, long array_index) } return pa->pdata[array_index]; } + +long ptr_array_size(ptrarray_t *pa) +{ + return pa->len; +} |