fix: fix tsim crash on windows due to invalid input to strftime

This commit is contained in:
Ganlin Zhao 2023-04-03 17:58:43 +08:00
parent 6c64b760a0
commit 8079532055
1 changed files with 1 additions and 1 deletions

View File

@ -473,7 +473,7 @@ static char* shellFormatTimestamp(char* buf, int64_t val, int32_t precision) {
struct tm ptm; struct tm ptm;
if (taosLocalTime(&tt, &ptm) == NULL) { if (taosLocalTime(&tt, &ptm) == NULL) {
sprintf(tt, "NaN"); sprintf(buf, "NaN");
return buf; return buf;
} }
size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm); size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm);