删除定时任务失败

This commit is contained in:
zogodo
2020-02-22 18:11:55 +08:00
parent 6aa012c620
commit 1baba58a15
4 changed files with 307 additions and 301 deletions

View File

@@ -93,7 +93,7 @@ bool DelTask(int time)
char* GetTaskStr()
{
char* str = (char*)malloc(sizeof(char)*(task_count*60+2));
char* str = (char*)malloc(sizeof(char)*(task_count*80+2));
pTimedTask tmp_tsk = task_top;
char* tmp_str = str;
tmp_str[0] = '[';
@@ -107,8 +107,8 @@ char* GetTaskStr()
tm_info = localtime(&prs_time);
strftime(buffer, 26, "%m-%d %H:%M:%S", tm_info);
sprintf(tmp_str, "{'prs_time':'%s','socket_idx':%d,'on':%d},",
buffer, tmp_tsk->socket_idx, tmp_tsk->on);
sprintf(tmp_str, "{'timestamp':%d,'prs_time':'%s','socket_idx':%d,'on':%d},",
tmp_tsk->prs_time, buffer, tmp_tsk->socket_idx, tmp_tsk->on);
tmp_str += strlen(tmp_str);
tmp_tsk = tmp_tsk->next;
}