This commit is contained in:
Maryna Kravtsova 2020-11-05 15:29:00 +01:00
parent 0368a7af28
commit 0069229806

View File

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