aboutsummaryrefslogtreecommitdiffstats
path: root/ast_expr2.y
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-17 00:33:00 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-17 00:33:00 +0000
commit8698db8b5da2eca74fb04b02e86a742fab4d500f (patch)
treed9fc14eb7b148abc23b71e1984a566e24cd9bc7e /ast_expr2.y
parent20cc8387a96393f0583cae71150c6fb3146a0f9c (diff)
Fix expression handling for string comparisions without quotes (bug #4478)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5919 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'ast_expr2.y')
-rwxr-xr-xast_expr2.y12
1 files changed, 10 insertions, 2 deletions
diff --git a/ast_expr2.y b/ast_expr2.y
index 14c84e856..dc0a37528 100755
--- a/ast_expr2.y
+++ b/ast_expr2.y
@@ -296,10 +296,11 @@ to_integer (struct val *vp)
/* vp->type == AST_EXPR_numeric_string, make it numeric */
errno = 0;
- i = strtoq(vp->u.s, (char**)NULL, 10);
+ i = strtoll(vp->u.s, (char**)NULL, 10);
if (errno != 0) {
+ ast_log(LOG_WARNING,"Conversion of %s to integer under/overflowed!\n", vp->u.s);
free(vp->u.s);
- ast_log(LOG_WARNING,"overflow\n");
+ vp->u.s = 0;
return(0);
}
free (vp->u.s);
@@ -433,8 +434,15 @@ op_eq (struct val *a, struct val *b)
to_string (b);
r = make_integer ((quad_t)(strcoll (a->u.s, b->u.s) == 0));
} else {
+#ifdef DEBUG_FOR_CONVERSIONS
+ char buffer[2000];
+ sprintf(buffer,"Converting '%s' and '%s' ", a->u.s, b->u.s);
+#endif
(void)to_integer(a);
(void)to_integer(b);
+#ifdef DEBUG_FOR_CONVERSIONS
+ ast_log(LOG_WARNING,"%s to '%lld' and '%lld'\n", buffer, a->u.i, b->u.i);
+#endif
r = make_integer ((quad_t)(a->u.i == b->u.i));
}