From ee3355ee541bf3b9d3cc1c748d1647c99fadc3c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=9D=E5=A1=94Linux=E5=BC=80=E5=8F=91=20-=20=E9=98=BF?= =?UTF-8?q?=E8=89=AF?= <287962566@qq.com> Date: Wed, 13 Apr 2022 17:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E4=BB=BB=E5=8A=A1=E6=95=B0=E7=BB=84=E5=85=83=E7=B4=A0?= =?UTF-8?q?=E5=A4=8D=E4=BD=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task/bt-task.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/task/bt-task.c b/task/bt-task.c index 30011dc7..76e8d439 100644 --- a/task/bt-task.c +++ b/task/bt-task.c @@ -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; @@ -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); } - } /**