This commit is contained in:
Maryna Kravtsova 2020-11-05 15:51:07 +01:00
parent 468b37d1be
commit d4271c3370

View File

@ -75,11 +75,15 @@ struct car* clear_train(struct car* first, const char* target) {
if(x == 0){ if(x == 0){
struct car* third = prev->next->next; struct car* third = prev->next->next;
free(prev->next); free(prev->next);
prev->next = third; prev->next = third;
return first;
} }
prev = prev->next; prev = prev->next;
} }
if(prev->next->next == NULL) { if(prev->next->next == NULL) {
int x = strcmp(first->value, target); int x = strcmp(first->value, target);
if(x == 0){ if(x == 0){