[asterisk-commits] mmichelson: branch mmichelson/digit_manipulation r196058 - /team/mmichelson/d...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 21 14:31:51 CDT 2009


Author: mmichelson
Date: Thu May 21 14:31:44 2009
New Revision: 196058

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196058
Log:
No need to use static buffers here. Grow the stack to the appropriate size.


Modified:
    team/mmichelson/digit_manipulation/apps/app_directed_pickup.c

Modified: team/mmichelson/digit_manipulation/apps/app_directed_pickup.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mmichelson/digit_manipulation/apps/app_directed_pickup.c?view=diff&rev=196058&r1=196057&r2=196058
==============================================================================
--- team/mmichelson/digit_manipulation/apps/app_directed_pickup.c (original)
+++ team/mmichelson/digit_manipulation/apps/app_directed_pickup.c Thu May 21 14:31:44 2009
@@ -93,16 +93,14 @@
 {
 	int res = 0;
 	struct ast_party_connected_line connected_caller;
-	char macro[AST_MAX_CONTEXT];
-	char macro_args[512]; /*XXX Big enough? */
+	const char * const macro = ast_strdupa(S_OR(pbx_builtin_getvar_helper(target, "CONNECTED_LINE_CALLEE_SEND_MACRO"), ""));
+	const char * const macro_args = ast_strdupa(S_OR(pbx_builtin_getvar_helper(target, "CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS"), ""));
 
 	ast_debug(1, "Call pickup on '%s' by '%s'\n", target->name, chan->name);
 
 	connected_caller = target->connected;
 	ast_party_connected_line_init(&target->connected);
 	connected_caller.source = AST_CONNECTED_LINE_UPDATE_SOURCE_ANSWER;
-	ast_copy_string(macro, S_OR(pbx_builtin_getvar_helper(target, "CONNECTED_LINE_CALLEE_SEND_MACRO"), ""), sizeof(macro));
-	ast_copy_string(macro_args, S_OR(pbx_builtin_getvar_helper(target, "CONNECTED_LINE_CALLEE_SEND_MACRO_ARGS"), ""), sizeof(macro_args));
 	if (!ast_strlen_zero(macro)) {
 		ast_party_connected_line_copy(&chan->connected, &connected_caller);
 		ast_app_run_macro(NULL, chan, macro, macro_args);




More information about the asterisk-commits mailing list