提交 fb905764 编写于 作者: S Shengliang Guan

[TD_543] fix coverity scan, cid:267767

上级 d27dcd5e
...@@ -32,12 +32,12 @@ bool httpCheckUsedbSql(char *sql) { ...@@ -32,12 +32,12 @@ bool httpCheckUsedbSql(char *sql) {
void httpTimeToString(time_t t, char *buf, int buflen) { void httpTimeToString(time_t t, char *buf, int buflen) {
memset(buf, 0, (size_t)buflen); memset(buf, 0, (size_t)buflen);
char ts[30] = {0}; char ts[32] = {0};
struct tm *ptm; struct tm *ptm;
time_t tt = t / 1000; time_t tt = t / 1000;
ptm = localtime(&tt); ptm = localtime(&tt);
strftime(ts, 64, "%Y-%m-%d %H:%M:%S", ptm); strftime(ts, 31, "%Y-%m-%d %H:%M:%S", ptm);
sprintf(buf, "%s.%03ld", ts, t % 1000); sprintf(buf, "%s.%03ld", ts, t % 1000);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册