mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-03-09 15:40:12 +00:00
Fix remove function
This commit is contained in:
parent
ed6564021d
commit
806bb9f1af
1 changed files with 12 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue