diff --git a/source/client/src/clientEnv.c b/source/client/src/clientEnv.c index faf72108aa..98782f74aa 100644 --- a/source/client/src/clientEnv.c +++ b/source/client/src/clientEnv.c @@ -720,13 +720,13 @@ int taos_init() { int taos_options_imp(TSDB_OPTION option, const char *str) { if (option == TSDB_OPTION_CONFIGDIR) { #ifndef WINDOWS + char newstr[PATH_MAX]; int len = strlen(str); if (len > 1 && str[0] != '"' && str[0] != '\'') { if (len + 2 >= PATH_MAX) { tscError("Too long path %s", str); return -1; } - char newstr[PATH_MAX]; newstr[0] = '"'; strncpy(newstr+1, str, len); newstr[len + 1] = '"';