[TD_543] fix coverity scan, cid:267767

This commit is contained in:
Shengliang Guan 2020-06-08 09:26:57 +00:00
parent d27dcd5e35
commit fb9057648b
1 changed files with 2 additions and 2 deletions

View File

@ -32,12 +32,12 @@ bool httpCheckUsedbSql(char *sql) {
void httpTimeToString(time_t t, char *buf, int buflen) {
memset(buf, 0, (size_t)buflen);
char ts[30] = {0};
char ts[32] = {0};
struct tm *ptm;
time_t tt = t / 1000;
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);
}