This commit is contained in:
Maryna Kravtsova 2020-11-03 10:32:01 +01:00
parent bd7d9eedb8
commit 22b91c853b

View File

@ -74,16 +74,12 @@ struct car* clear_train(struct car* first, const char* target) {
}
}
else{
struct car* prev = first;
while(prev->next->next != NULL){
x = strcmp(prev->next->value, target);
if(x == 0){
struct car* third = prev->next->next;
free(prev->next);
break;
struct car* this = first;
while(this != NULL){
if(this->value == target){
return 0;
}
prev = prev->next;
this = this->next;
}
}
return first;