This commit is contained in:
zogodo
2019-12-26 22:43:09 +08:00
parent e20d0412f4
commit c345f53e5e

View File

@@ -28,8 +28,9 @@ bool AddTask(pTimedTask task)
pTimedTask tmp = task_top; pTimedTask tmp = task_top;
while (tmp) while (tmp)
{ {
if ((task->prs_time > tmp->prs_time && task->prs_time <= tmp->next->prs_time) if (tmp->next == NULL
|| tmp->next == NULL) || (task->prs_time >= tmp->prs_time
&& task->prs_time < tmp->next->prs_time))
{ {
task->next = tmp->next; task->next = tmp->next;
tmp->next = task; tmp->next = task;