diff --git a/utils/test/c/tmqSim.c b/utils/test/c/tmqSim.c index d81c70c65d..5eeb0aaa12 100644 --- a/utils/test/c/tmqSim.c +++ b/utils/test/c/tmqSim.c @@ -473,7 +473,7 @@ static char* shellFormatTimestamp(char* buf, int64_t val, int32_t precision) { struct tm ptm; if (taosLocalTime(&tt, &ptm) == NULL) { - sprintf(tt, "NaN"); + sprintf(buf, "NaN"); return buf; } size_t pos = strftime(buf, 35, "%Y-%m-%d %H:%M:%S", &ptm);