From 96f691cd5c04ac2eb32cdd13e992891962d21dd9 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 22 Nov 2022 11:12:20 +0800 Subject: [PATCH] avoid invalid error --- source/common/src/tglobal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/common/src/tglobal.c b/source/common/src/tglobal.c index 27dcbd5be3..f2d8b9aa7c 100644 --- a/source/common/src/tglobal.c +++ b/source/common/src/tglobal.c @@ -277,7 +277,9 @@ static int32_t taosAddServerLogCfg(SConfig *pCfg) { static int32_t taosAddClientCfg(SConfig *pCfg) { char defaultFqdn[TSDB_FQDN_LEN] = {0}; int32_t defaultServerPort = 6030; - if (taosGetFqdn(defaultFqdn) != 0) return -1; + if (taosGetFqdn(defaultFqdn) != 0) { + strcpy(defaultFqdn, "localhost"); + } if (cfgAddString(pCfg, "firstEp", "", 1) != 0) return -1; if (cfgAddString(pCfg, "secondEp", "", 1) != 0) return -1;