This commit is contained in:
Valér Jakubčo 2021-11-04 20:52:07 +01:00
parent 7aaca319e2
commit 560f813276

View File

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