Merge pull request #23935 from taosdata/fix/alexduan-3.0

fix: strncpy replace with memcpy on 3.0
This commit is contained in:
Alex Duan 2023-12-05 19:54:21 +08:00 committed by GitHub
commit 0c9e07fdd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -732,7 +732,7 @@ int taos_options_imp(TSDB_OPTION option, const char *str) {
return -1;
}
newstr[0] = '"';
strncpy(newstr+1, str, len);
memcpy(newstr+1, str, len);
newstr[len + 1] = '"';
newstr[len + 2] = '\0';
str = newstr;