非常傻的问题

This commit is contained in:
zogodo
2020-01-10 21:13:02 +08:00
parent 801fc8eccb
commit eff4783bc4
2 changed files with 4 additions and 7 deletions

View File

@@ -279,10 +279,10 @@ static int HttpDelTask(httpd_request_t *req)
char* time_str = strstr(req->filename, "?time="); char* time_str = strstr(req->filename, "?time=");
app_httpd_log("HttpDelTask url[%s] time_str[%s][%s]", req->filename, time_str, time_str + 6); app_httpd_log("HttpDelTask url[%s] time_str[%s][%s]", req->filename, time_str, time_str + 6);
int time; int time1;
sscanf(time_str + 6, "%d", &time); sscanf(time_str + 6, "%d", &time1);
char* mess = DelTask(time) ? "OK" : "NO"; char* mess = DelTask(time1) ? "OK" : "NO";
OSStatus err = kNoErr; OSStatus err = kNoErr;
send_http(mess, strlen(mess), exit, &err); send_http(mess, strlen(mess), exit, &err);

View File

@@ -1,7 +1,4 @@
#include <time.h> #include <time.h>
#include "mico.h"
#include "micokit_ext.h"
#include "sys/time.h"
#ifndef WEB_LOG_H #ifndef WEB_LOG_H
#define WEB_LOG_H #define WEB_LOG_H
@@ -26,7 +23,7 @@ char* GetLogRecord(int idx);
#define web_log(format, ...) \ #define web_log(format, ...) \
LOG_TMP = (char*)malloc(sizeof(char)*LOG_LEN); \ 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)); \ strftime(time_buf, TIM_LEN, "[%Y-%m-%d %H:%M:%S]", localtime(&now)); \
snprintf(LOG_TMP, LOG_LEN, "%s"format, time_buf, ##__VA_ARGS__); \ snprintf(LOG_TMP, LOG_LEN, "%s"format, time_buf, ##__VA_ARGS__); \
SetLogRecord(&log_record, LOG_TMP); \ SetLogRecord(&log_record, LOG_TMP); \