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 23ec9287c9
commit 4819b22a21
1 changed files with 1 additions and 2 deletions

View File

@ -213,8 +213,7 @@ static int32_t addTimezoneParam(SNodeList* pList) {
char buf[6] = {0}; char buf[6] = {0};
time_t t = taosTime(NULL); time_t t = taosTime(NULL);
struct tm tmInfo; struct tm tmInfo;
if (taosLocalTime(&t, &tmInfo, buf) == NULL) { if (taosLocalTime(&t, &tmInfo, buf) != NULL) {
} else {
strftime(buf, sizeof(buf), "%z", &tmInfo); strftime(buf, sizeof(buf), "%z", &tmInfo);
} }
int32_t len = (int32_t)strlen(buf); int32_t len = (int32_t)strlen(buf);