diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-08-29 22:03:37 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-08-29 22:03:37 +0000 |
commit | 558f8be1b81fd211756afb3f3814490bfc0763d7 (patch) | |
tree | e6aa0fcc15c7915e5b37a2267d1c36c2c86f0b19 /pbx.c | |
parent | 02052f2d90c56c341514e1b0ed5f62c65f9ea142 (diff) |
don't make expression evaluator allocate a memory buffer for each result
to
be returned; use the buffers already present in the PBX for this purpose
update testexpr2/check_expr to allocate buffers for expression
evaluation
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6440 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-x | pbx.c | 15 |
1 files changed, 4 insertions, 11 deletions
@@ -1522,19 +1522,12 @@ static void pbx_substitute_variables_helper_full(struct ast_channel *c, const ch vars = var; } - /* Evaluate expression */ - cp4 = ast_expr(vars); - - ast_log(LOG_DEBUG, "Expression is '%s'\n", cp4); - - if (cp4) { - length = strlen(cp4); - if (length > count) - length = count; - memcpy(cp2, cp4, length); + length = ast_expr(vars, cp2, count); + + if (length) { + ast_log(LOG_DEBUG, "Expression result is '%s'\n", cp2); count -= length; cp2 += length; - free(cp4); } } else break; |