Skip to content
Snippets Groups Projects
Commit f3b5e166 authored by Mark Spencer's avatar Mark Spencer
Browse files

Actually set variable name before using

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 783fddae
No related branches found
No related tags found
No related merge requests found
...@@ -129,10 +129,10 @@ static int macro_exec(struct ast_channel *chan, void *data) ...@@ -129,10 +129,10 @@ static int macro_exec(struct ast_channel *chan, void *data)
while((cur = strsep(&rest, "|")) && (argc < MAX_ARGS)) { while((cur = strsep(&rest, "|")) && (argc < MAX_ARGS)) {
/* Save copy of old arguments if we're overwriting some, otherwise /* Save copy of old arguments if we're overwriting some, otherwise
let them pass through to the other macro */ let them pass through to the other macro */
snprintf(varname, sizeof(varname), "ARG%d", argc);
oldargs[argc] = pbx_builtin_getvar_helper(chan, varname); oldargs[argc] = pbx_builtin_getvar_helper(chan, varname);
if (oldargs[argc]) if (oldargs[argc])
oldargs[argc] = strdup(oldargs[argc]); oldargs[argc] = strdup(oldargs[argc]);
snprintf(varname, sizeof(varname), "ARG%d", argc);
pbx_builtin_setvar_helper(chan, varname, cur); pbx_builtin_setvar_helper(chan, varname, cur);
argc++; argc++;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment