This commit is contained in:
Maryna Kravtsova 2020-11-04 13:10:12 +01:00
parent 31432ec6b3
commit 0c8f1acd31

View File

@ -69,7 +69,6 @@ struct car* clear_train(struct car* first, const char* target) {
struct car* third = prev->next->next;
free(prev->next);
prev->next = third;
third->next = NULL;
return first;
}
prev = prev->next;
@ -77,7 +76,7 @@ struct car* clear_train(struct car* first, const char* target) {
int x = strcmp(prev->next->value, target);
if(x == 0){
free(prev->next);
prev->next = NULL;
prev->next->next = NULL;
return first;
}