mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 10:47:18 +00:00 
			
		
		
		
	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: https://origsvn.digium.com/svn/asterisk/trunk@6440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		
							
								
								
									
										13
									
								
								ast_expr2.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								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 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user