From f518aa96c6da6a9fdf76478bda63d10a8319788e Mon Sep 17 00:00:00 2001 From: Xiaxin Li Date: Thu, 16 Dec 2021 15:28:58 +0800 Subject: [PATCH] Update tnettest.c --- src/util/src/tnettest.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/src/tnettest.c b/src/util/src/tnettest.c index d5db42c04c..c6d64d1ae5 100644 --- a/src/util/src/tnettest.c +++ b/src/util/src/tnettest.c @@ -364,7 +364,7 @@ static int32_t taosNetCheckRpc(const char* serverFqdn, uint16_t port, uint16_t p reqMsg.code = 0; reqMsg.handle = NULL; // rpc handle returned to app reqMsg.ahandle = NULL; // app handle set by client - tstrncpy(reqMsg.pCont, "nettest", sizeof(reqMsg.pCont)); + tstrncpy((char*)reqMsg.pCont, "nettest", pkgLen); rpcSendRecv(pRpcConn, &epSet, &reqMsg, &rspMsg); @@ -608,8 +608,8 @@ static void taosNetCheckSpeed(char *host, int32_t port, int32_t pkgLen, reqMsg.code = 0; reqMsg.handle = NULL; // rpc handle returned to app reqMsg.ahandle = NULL; // app handle set by client - tstrncpy(reqMsg.pCont, "nettest speed", sizeof(reqMsg.pCont)); - + tstrncpy((char*)reqMsg.pCont, "nettest speed", pkgLen); + rpcSendRecv(pRpcConn, &epSet, &reqMsg, &rspMsg); int code = 0; -- GitLab