From bfde050b2f2c6aa9e138fd9f1015c4092579aa5d Mon Sep 17 00:00:00 2001 From: Benguang Zhao Date: Tue, 21 Jun 2022 19:04:14 +0800 Subject: [PATCH] fix: compilation with visual c on win --- src/plugins/monitor/src/monMain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/monitor/src/monMain.c b/src/plugins/monitor/src/monMain.c index 2cd0139f5b..1ff2f0ef8d 100644 --- a/src/plugins/monitor/src/monMain.c +++ b/src/plugins/monitor/src/monMain.c @@ -719,10 +719,9 @@ static int32_t monBuildMnodesTotalSql(char *sql) { static int32_t monGetVgroupsTotalStats(char *dbName, int32_t *totalVgroups, int32_t *totalVgroupsAlive) { - int bufLen = TSDB_DB_NAME_LEN + 16; - char subsql[bufLen]; + char subsql[TSDB_DB_NAME_LEN + 16]; memset(subsql, 0, sizeof(subsql)); - snprintf(subsql, bufLen - 1, "show `%s`.vgroups", dbName); + snprintf(subsql, sizeof(subsql) - 1, "show `%s`.vgroups", dbName); TAOS_RES *result = taos_query(tsMonitor.conn, subsql); int32_t code = taos_errno(result); if (code != TSDB_CODE_SUCCESS) { -- GitLab