diff --git a/src/sf_cluster_cfg.c b/src/sf_cluster_cfg.c index 877c5df..55aa693 100644 --- a/src/sf_cluster_cfg.c +++ b/src/sf_cluster_cfg.c @@ -105,13 +105,12 @@ static int load_server_cfg(SFClusterConfig *cluster, return 0; } -int sf_load_cluster_config_ex(SFClusterConfig *cluster, - IniFullContext *ini_ctx, const int default_port, +int sf_load_cluster_config_ex(SFClusterConfig *cluster, IniFullContext + *ini_ctx, const int default_port, char *full_cluster_filename, char *full_server_filename, const int size) { int result; char *cluster_config_filename; - char full_cluster_filename[PATH_MAX]; cluster_config_filename = iniGetStrValue(ini_ctx->section_name, "cluster_config_filename", ini_ctx->context); @@ -123,7 +122,7 @@ int sf_load_cluster_config_ex(SFClusterConfig *cluster, } resolve_path(ini_ctx->filename, cluster_config_filename, - full_cluster_filename, sizeof(full_cluster_filename)); + full_cluster_filename, size); if ((result=load_server_cfg(cluster, full_cluster_filename, default_port, full_server_filename, size)) != 0) { diff --git a/src/sf_cluster_cfg.h b/src/sf_cluster_cfg.h index dcb3112..87e48b2 100644 --- a/src/sf_cluster_cfg.h +++ b/src/sf_cluster_cfg.h @@ -23,16 +23,17 @@ extern "C" { #endif -int sf_load_cluster_config_ex(SFClusterConfig *cluster, - IniFullContext *ini_ctx, const int default_port, +int sf_load_cluster_config_ex(SFClusterConfig *cluster, IniFullContext + *ini_ctx, const int default_port, char *full_cluster_filename, char *full_server_filename, const int size); static inline int sf_load_cluster_config(SFClusterConfig *cluster, IniFullContext *ini_ctx, const int default_port) { + char full_cluster_filename[PATH_MAX]; char full_server_filename[PATH_MAX]; return sf_load_cluster_config_ex(cluster, ini_ctx, default_port, - full_server_filename, sizeof(full_server_filename)); + full_cluster_filename, full_server_filename, PATH_MAX); } #ifdef __cplusplus