null v remove snake
This commit is contained in:
		
							parent
							
								
									e0d1836e55
								
							
						
					
					
						commit
						a1c8c93d51
					
				@ -10,7 +10,8 @@ struct snake* add_snake(struct snake* snake,int x,int y){
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct snake* remove_snake(struct snake* snake){
 | 
					struct snake* remove_snake(struct snake* snake){
 | 
				
			||||||
    	struct snake* part = snake;
 | 
						struct snake* part = snake;
 | 
				
			||||||
 | 
						if (snake == NULL) return NULL;
 | 
				
			||||||
	if (part->next == NULL) {
 | 
						if (part->next == NULL) {
 | 
				
			||||||
		free(part);
 | 
							free(part);
 | 
				
			||||||
		return NULL;
 | 
							return NULL;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user