| * See COPYING for copyright and distribution information. |
| #include "DynamicUCharArray.h" |
| ndn_Error ndn_DynamicUCharArray_reallocArray(struct ndn_DynamicUCharArray *self, unsigned int length) |
| return NDN_ERROR_DynamicUCharArray_realloc_function_pointer_not_supplied; |
| // See if double is enough. |
| unsigned int newLength = self->length * 2; |
| // The needed length is much greater, so use it. |
| unsigned char *newArray = (*self->realloc)(self->array, newLength); |
| return NDN_ERROR_DynamicUCharArray_realloc_failed; |
| self->length = newLength; |