diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index e9b281f..f2ed851 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -279,10 +279,10 @@ static int HttpDelTask(httpd_request_t *req) char* time_str = strstr(req->filename, "?time="); app_httpd_log("HttpDelTask url[%s] time_str[%s][%s]", req->filename, time_str, time_str + 6); - int time; - sscanf(time_str + 6, "%d", &time); + int time1; + sscanf(time_str + 6, "%d", &time1); - char* mess = DelTask(time) ? "OK" : "NO"; + char* mess = DelTask(time1) ? "OK" : "NO"; OSStatus err = kNoErr; send_http(mess, strlen(mess), exit, &err); diff --git a/TC1/http_server/web_log.h b/TC1/http_server/web_log.h index 10681ab..99c8c44 100644 --- a/TC1/http_server/web_log.h +++ b/TC1/http_server/web_log.h @@ -1,7 +1,4 @@ #include -#include "mico.h" -#include "micokit_ext.h" -#include "sys/time.h" #ifndef WEB_LOG_H #define WEB_LOG_H @@ -26,7 +23,7 @@ char* GetLogRecord(int idx); #define web_log(format, ...) \ LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \ - now = 1234567; \ + now = time(NULL); \ strftime(time_buf, TIM_LEN, "[%Y-%m-%d %H:%M:%S]", localtime(&now)); \ snprintf(LOG_TMP, LOG_LEN, "%s"format, time_buf, ##__VA_ARGS__); \ SetLogRecord(&log_record, LOG_TMP); \