diff --git a/src/util/src/tnettest.c b/src/util/src/tnettest.c index d5db42c04c9ea60b1fdda40701f4fbd704d2b461..c6d64d1ae5dc9d290e47f2f7033dbb14558a1d66 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;