From e9563fbf5df56dfcf6567d5a3008c1e9a304cd19 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 5 Jun 2006 18:12:33 +0000 Subject: [PATCH] make snprintf commands use the path seperator macro. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1544 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/languages/mod_spidermonkey/mod_spidermonkey.c | 2 +- src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c | 2 +- src/switch_config.c | 4 ++-- src/switch_core.c | 2 +- src/switch_xml.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c index adf949c93a..c0904cd7d8 100644 --- a/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c +++ b/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c @@ -2003,7 +2003,7 @@ static int eval_some_js(char *code, JSContext *cx, JSObject *obj, jsval *rval) if (code[0] == '/') { script = JS_CompileFile(cx, obj, code); } else { - snprintf(path, sizeof(path), "%s/%s", SWITCH_GLOBAL_dirs.script_dir, code); + snprintf(path, sizeof(path), "%s%s%s", SWITCH_GLOBAL_dirs.script_dir, SWITCH_PATH_SEPARATOR, code); script = JS_CompileFile(cx, obj, path); } } diff --git a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c index 787f55962e..553814c141 100644 --- a/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c +++ b/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c @@ -323,7 +323,7 @@ SWITCH_MOD_DECLARE(switch_status_t) switch_module_runtime(void) MIMETypeInit(); MIMETypeAdd("text/html", "html"); - snprintf(logfile, sizeof(logfile), "%s/%s", SWITCH_GLOBAL_dirs.log_dir, "freeswitch_http.log"); + snprintf(logfile, sizeof(logfile), "%s%s%s", SWITCH_GLOBAL_dirs.log_dir, SWITCH_PATH_SEPARATOR, "freeswitch_http.log"); ServerCreate(&abyssServer, "XmlRpcServer", globals.port, SWITCH_GLOBAL_dirs.htdocs_dir, logfile); xmlrpc_server_abyss_set_handler(&env, &abyssServer, "/RPC2", registryP); diff --git a/src/switch_config.c b/src/switch_config.c index 8b33a8a997..31776dcaf9 100644 --- a/src/switch_config.c +++ b/src/switch_config.c @@ -41,7 +41,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_pat if (file_path[0] == '/') { path = file_path; } else { - snprintf(path_buf, sizeof(path_buf), "%s/%s", SWITCH_GLOBAL_dirs.conf_dir, file_path); + snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, file_path); path = path_buf; } @@ -57,7 +57,7 @@ SWITCH_DECLARE(int) switch_config_open_file(switch_config_t *cfg, char *file_pat int last = -1; char *var, *val; - snprintf(path_buf, sizeof(path_buf), "%s/freeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir); + snprintf(path_buf, sizeof(path_buf), "%s%sfreeswitch.conf", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR); path = path_buf; if ((f = fopen(path, "r")) == 0) { diff --git a/src/switch_core.c b/src/switch_core.c index 08032bf612..dac6069e5a 100644 --- a/src/switch_core.c +++ b/src/switch_core.c @@ -117,7 +117,7 @@ static void db_pick_path(char *dbname, char *buf, switch_size_t size) if (strchr(dbname, '/')) { strncpy(buf, dbname, size); } else { - snprintf(buf, size, "%s/%s.db", SWITCH_DB_DIR, dbname); + snprintf(buf, size, "%s%s%s.db", SWITCH_DB_DIR, SWITCH_PATH_SEPARATOR, dbname); } } diff --git a/src/switch_xml.c b/src/switch_xml.c index f9e210bd2b..3e5bc363a7 100644 --- a/src/switch_xml.c +++ b/src/switch_xml.c @@ -900,7 +900,7 @@ SWITCH_DECLARE(switch_xml_t) switch_xml_open_root(uint8_t reload, const char **e switch_xml_free(xml); } - snprintf(path_buf, sizeof(path_buf), "%s/%s", SWITCH_GLOBAL_dirs.conf_dir, "freeswitch.xml"); + snprintf(path_buf, sizeof(path_buf), "%s%s%s", SWITCH_GLOBAL_dirs.conf_dir, SWITCH_PATH_SEPARATOR, "freeswitch.xml"); if ((MAIN_XML_ROOT = switch_xml_parse_file(path_buf))) { *err = switch_xml_error(MAIN_XML_ROOT);