This commit is contained in:
Maryna Kravtsova 2020-11-05 15:34:20 +01:00
parent 73475fc126
commit 8d777667f6

View File

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