This commit is contained in:
Maryna Kravtsova 2020-11-03 21:23:12 +01:00
parent 2716eb2775
commit 81c09c06b7

View File

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