Skip to content

Commit

Permalink
修复环境安装任务数组元素复位问题
Browse files Browse the repository at this point in the history
  • Loading branch information
showpy committed Apr 13, 2022
1 parent ccca951 commit ee3355e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion task/bt-task.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ void get_task_list(struct task_info *task_list){
task_list[n].id = atoi(table_data[i]);
break;
case 1:
task_list[n].type[0] = '\0';
strcpy(task_list[n].type,table_data[i]);
break;
case 2:
task_list[n].execstr[0] = '\0';
strcpy(task_list[n].execstr,table_data[i]);
n++; // 行数加1
break;
Expand Down Expand Up @@ -131,10 +133,10 @@ void *start_task(void * arg){
char *_sql2 = sqlite3_mprintf("UPDATE tasks SET status=1,end=%d WHERE id=%d",end,task_list[i].id);
execute(_sql2,db_file);
sqlite3_free(_sql2);
task_list[i].id = 0;
}
sleep(_cycle);
}

}

/**
Expand Down

0 comments on commit ee3355e

Please sign in to comment.