This commit is contained in:
Valér Jakubčo 2021-11-05 08:29:43 +01:00
parent 1cc637bbf4
commit cadda9577c

View File

@ -75,7 +75,7 @@ struct car* clear_train(struct car* first, const char* target) {
} }
if(strcmp(this->next->value, target) == 0){ if(strcmp(this->next->value, target) == 0){
free(this->next); free(this->next);
this->next=NULL; this->next=this->next->next;
return this; return this;
}else if(strcmp(this->next->next->value, target) == 0){ }else if(strcmp(this->next->next->value, target) == 0){
free(this->next->next); free(this->next->next);