From 751e3976a506501d3f11fa0c7b39d6e951ddb6f2 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Fri, 27 Mar 2009 18:30:32 +0000 Subject: [PATCH] Use switch_channel_set_variable_printf instead of snprintf of a stack-allocated buffer git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12807 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_originate.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 5a6eb00f8b..f627a109a5 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -547,15 +547,10 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat const char *var = switch_channel_get_variable(caller_channel, "inherit_codec"); if (switch_true(var)) { switch_codec_implementation_t impl; - char tmp[128] = ""; - switch_core_session_get_read_impl(originate_status[pindex].peer_session, &impl); - switch_snprintf(tmp, sizeof(tmp), "%s@%uk@%ui", impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000); - switch_channel_set_variable(caller_channel, "absolute_codec_string", tmp); + switch_channel_set_variable_printf(caller_channel, "absolute_codec_string", "%s@%uk@%ui", impl.iananame, impl.samples_per_second, impl.microseconds_per_packet / 1000); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Setting codec string on %s to %s\n", switch_channel_get_name(caller_channel), tmp); - - } }