aboutsummaryrefslogtreecommitdiffstats
path: root/ast_expr2.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-29 22:03:37 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-08-29 22:03:37 +0000
commit558f8be1b81fd211756afb3f3814490bfc0763d7 (patch)
treee6aa0fcc15c7915e5b37a2267d1c36c2c86f0b19 /ast_expr2.c
parent02052f2d90c56c341514e1b0ed5f62c65f9ea142 (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 'ast_expr2.c')
-rwxr-xr-xast_expr2.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/ast_expr2.c b/ast_expr2.c
index 685276a11..c841616f5 100755
--- a/ast_expr2.c
+++ b/ast_expr2.c
@@ -1734,7 +1734,7 @@ to_string (struct val *vp)
return;
}
- sprintf (tmp, "%ld", vp->u.i);
+ sprintf(tmp, "%ld", (long int) vp->u.i);
vp->type = AST_EXPR_string;
vp->u.s = tmp;
}
@@ -1775,11 +1775,12 @@ void ast_log(int level, const char *file, int line, const char *function, const
int main(int argc,char **argv) {
- char *s;
-
- s=ast_expr(argv[1]);
-
- printf("=====%s======\n",s);
+ char s[4096];
+
+ if (ast_expr(argv[1], s, sizeof(s)))
+ printf("=====%s======\n",s);
+ else
+ printf("No result\n");
}
#endif