Fix remove function

This commit is contained in:
PolynomialDivision 2017-06-11 19:32:38 +02:00
parent ed6564021d
commit 806bb9f1af

View file

@ -182,9 +182,18 @@ node* remove_old_entries(node* head, time_t current_time, long long int threshol
if(next->data.time < current_time - threshold)
{
head = remove_node(head, next, prev);
//print_list_with_head(head);
next = prev->ptr;
} else {
//print_list_with_head(head);
if(prev == NULL) // removed head
{
next = head;
}
else
{
next = prev->ptr;
}
}
else
{
prev = next;
next = next->ptr;
}