This commit is contained in:
Maryna Kravtsova 2020-11-03 10:46:03 +01:00
parent d638476ad0
commit ce3648c65b

View File

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