cocci: FLEX_ALLOC_MEM to FLEX_ALLOC_STR
Ensure that a FLEX_MALLOC_MEM that uses 'strlen' for its 'len' uses FLEX_ALLOC_STR instead, since these are equivalent forms. Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
		 Denton Liu
					Denton Liu
				
			
				
					committed by
					
						 Junio C Hamano
						Junio C Hamano
					
				
			
			
				
	
			
			
			 Junio C Hamano
						Junio C Hamano
					
				
			
						parent
						
							577314caae
						
					
				
				
					commit
					0cf2b0a04b
				
			
							
								
								
									
										13
									
								
								contrib/coccinelle/flex_alloc.cocci
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								contrib/coccinelle/flex_alloc.cocci
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,13 @@ | ||||
| @@ | ||||
| expression str; | ||||
| identifier x, flexname; | ||||
| @@ | ||||
| - FLEX_ALLOC_MEM(x, flexname, str, strlen(str)); | ||||
| + FLEX_ALLOC_STR(x, flexname, str); | ||||
|  | ||||
| @@ | ||||
| expression str; | ||||
| identifier x, ptrname; | ||||
| @@ | ||||
| - FLEXPTR_ALLOC_MEM(x, ptrname, str, strlen(str)); | ||||
| + FLEXPTR_ALLOC_STR(x, ptrname, str); | ||||
		Reference in New Issue
	
	Block a user