diff options
Diffstat (limited to 'ast_expr2.y')
-rwxr-xr-x | ast_expr2.y | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ast_expr2.y b/ast_expr2.y index 47a0c7ed1..b25917cc4 100755 --- a/ast_expr2.y +++ b/ast_expr2.y @@ -349,7 +349,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; } @@ -390,11 +390,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 |