This commit is contained in:
Maryna Kravtsova 2020-11-03 11:05:36 +01:00
parent 727845e0c9
commit 194849ce29

View File

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