fix: fix coverity scan issues

This commit is contained in:
shenglian zhou 2022-10-09 10:55:38 +08:00
parent 5be42222dc
commit 9a82f3521b
1 changed files with 2 additions and 2 deletions

View File

@ -959,8 +959,8 @@ int32_t udfdInitResidentFuncs() {
char* pSave = tsUdfdResFuncs;
char* token;
while ((token = strtok_r(pSave, ",", &pSave)) != NULL) {
char func[TSDB_FUNC_NAME_LEN] = {0};
strncpy(func, token, sizeof(func));
char func[TSDB_FUNC_NAME_LEN+1] = {0};
strncpy(func, token, TSDB_FUNC_NAME_LEN);
taosArrayPush(global.residentFuncs, func);
}