| * BSD license, See the LICENSE file for more information. |
| #include "DynamicUCharArray.h" |
| char *ndn_DynamicUCharArray_reallocArray(struct ndn_DynamicUCharArray *self, unsigned int length) |
| return "ndn_DynamicUCharArray_reallocArray: 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_DynamicUCharArray_reallocArray: realloc failed"; |
| self->length = newLength; |