1
0
mirror of https://gitlab.xiph.org/xiph/icecast-common.git synced 2024-06-23 06:25:25 +00:00

Fix: Corrected offset and fill pointer on realign

This commit is contained in:
Philipp Schafft 2018-11-08 10:54:08 +00:00
parent eec0dc6c84
commit 4b579f596c

View File

@ -53,10 +53,15 @@ static void __free(igloo_ro_t self)
static inline void igloo_list_preallocate__realign(igloo_list_t *list)
{
size_t new_len;
if (!list->offset)
return;
memmove(list->elements, list->elements + list->offset, (list->fill - list->offset)*sizeof(*list->elements));
new_len = list->fill - list->offset;
memmove(list->elements, list->elements + list->offset, new_len*sizeof(*list->elements));
list->offset = 0;
list->fill = new_len;
}
void igloo_list_preallocate(igloo_list_t *list, size_t request)