}
if (count+1 >= alloc_count) {
new_alloc_count = nearest_power(alloc_count+1);
- size_t old_size =
- MALLOC_MULTIPLY(sizeof(char *), alloc_count);
- size_t new_size =
- MALLOC_MULTIPLY(sizeof(char *), new_alloc_count);
- array = p_realloc(pool, array,
- old_size, new_size);
+ array = p_realloc_type(pool, array, char *,
+ alloc_count, new_alloc_count);
alloc_count = new_alloc_count;
}
*data++ = '\0';
/* separator found */
if (count+1 >= alloc_count) {
new_alloc_count = nearest_power(alloc_count+1);
- size_t old_size =
- MALLOC_MULTIPLY(sizeof(char *), alloc_count);
- size_t new_size =
- MALLOC_MULTIPLY(sizeof(char *), new_alloc_count);
- array = p_realloc(pool, array,
- old_size, new_size);
+ array = p_realloc_type(pool, array, char *,
+ alloc_count, new_alloc_count);
alloc_count = new_alloc_count;
}
/* separator found */
if (count+1 >= alloc_count) {
new_alloc_count = nearest_power(alloc_count+1);
- size_t old_size =
- MALLOC_MULTIPLY(sizeof(char *), alloc_count);
- size_t new_size =
- MALLOC_MULTIPLY(sizeof(char *), new_alloc_count);
- array = p_realloc(pool, array,
- old_size, new_size);
+ array = p_realloc_type(pool, array, char *,
+ alloc_count, new_alloc_count);
alloc_count = new_alloc_count;
}
*str++ = '\0';