fix make errors.

This commit is contained in:
xiao-77 2024-12-16 12:18:06 +08:00
parent dc4dedd32c
commit 0bf2280223
3 changed files with 5 additions and 5 deletions

View File

@ -24,7 +24,7 @@ extern "C" {
#endif
int32_t taosEnvNameToCfgName(const char *envNameStr, char *cfgNameStr, int32_t cfgNameMaxLen);
int32_t taosEnvToCfg(const char *envStr, char *cfgStr);
int32_t taosEnvToCfg(const char *envStr, char *cfgStr,int32_t cfgStrLen);
#ifdef __cplusplus
}

View File

@ -1195,7 +1195,7 @@ int32_t cfgLoadFromEnvVar(SConfig *pConfig) {
tstrncpy(line, *pEnv, sizeof(line));
pEnv++;
if (taosEnvToCfg(line, line) < 0) {
if (taosEnvToCfg(line, line, 1024) < 0) {
uTrace("failed to convert env to cfg:%s", line);
}
@ -1240,7 +1240,7 @@ int32_t cfgLoadFromEnvCmd(SConfig *pConfig, const char **envCmd) {
while (envCmd[index] != NULL) {
tstrncpy(buf, envCmd[index], sizeof(buf));
buf[sizeof(buf) - 1] = 0;
if (taosEnvToCfg(buf, buf) < 0) {
if (taosEnvToCfg(buf, buf, 1024) < 0) {
uTrace("failed to convert env to cfg:%s", buf);
}
index++;
@ -1314,7 +1314,7 @@ int32_t cfgLoadFromEnvFile(SConfig *pConfig, const char *envFile) {
break;
}
if (line[_bytes - 1] == '\n') line[_bytes - 1] = 0;
if (taosEnvToCfg(line, line) < 0) {
if (taosEnvToCfg(line, line, 1024) < 0) {
uTrace("failed to convert env to cfg:%s", line);
}

View File

@ -50,7 +50,7 @@ int32_t taosEnvNameToCfgName(const char *envNameStr, char *cfgNameStr, int32_t c
return strlen(cfgNameStr);
}
int32_t taosEnvToCfg(const char *envStr, char *cfgStr) {
int32_t taosEnvToCfg(const char *envStr, char *cfgStr,int32_t cfgStrLen) {
if (envStr == NULL || cfgStr == NULL) {
return TSDB_CODE_INVALID_PARA;
}