fix test failed

This commit is contained in:
facetosea 2023-10-12 15:04:53 +08:00
parent 8d1e427861
commit 81dc3e7ea2
1 changed files with 1 additions and 1 deletions

View File

@ -720,13 +720,13 @@ int taos_init() {
int taos_options_imp(TSDB_OPTION option, const char *str) { int taos_options_imp(TSDB_OPTION option, const char *str) {
if (option == TSDB_OPTION_CONFIGDIR) { if (option == TSDB_OPTION_CONFIGDIR) {
#ifndef WINDOWS #ifndef WINDOWS
char newstr[PATH_MAX];
int len = strlen(str); int len = strlen(str);
if (len > 1 && str[0] != '"' && str[0] != '\'') { if (len > 1 && str[0] != '"' && str[0] != '\'') {
if (len + 2 >= PATH_MAX) { if (len + 2 >= PATH_MAX) {
tscError("Too long path %s", str); tscError("Too long path %s", str);
return -1; return -1;
} }
char newstr[PATH_MAX];
newstr[0] = '"'; newstr[0] = '"';
strncpy(newstr+1, str, len); strncpy(newstr+1, str, len);
newstr[len + 1] = '"'; newstr[len + 1] = '"';