fixed segfault
thanks to chneukirchen
This commit is contained in:
parent
f7109c9b19
commit
5a5211006e
10
dunst.c
10
dunst.c
@ -183,14 +183,20 @@ int list_len(msg_queue_t *list) {
|
|||||||
|
|
||||||
void
|
void
|
||||||
check_timeouts(void) {
|
check_timeouts(void) {
|
||||||
msg_queue_t *cur;
|
msg_queue_t *cur, *next;
|
||||||
|
|
||||||
for(cur = msgqueue; cur != NULL; cur = cur->next) {
|
cur = msgqueue;
|
||||||
|
while(cur != NULL) {
|
||||||
if(cur->start == 0 || cur->timeout == 0) {
|
if(cur->start == 0 || cur->timeout == 0) {
|
||||||
|
cur = cur->next;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(difftime(now, cur->start) > cur->timeout) {
|
if(difftime(now, cur->start) > cur->timeout) {
|
||||||
|
next = cur->next;
|
||||||
delete_msg(cur);
|
delete_msg(cur);
|
||||||
|
cur = next;
|
||||||
|
} else {
|
||||||
|
cur = cur->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user