zly return

This commit is contained in:
Valér Jakubčo 2021-11-04 20:38:28 +01:00
parent 41d4e7acb0
commit 03dce445b6

View File

@ -48,18 +48,18 @@ struct car* clear_train(struct car* first, const char* target) {
free(this); free(this);
return NULL; return NULL;
}else { }else {
return first; return this;
} }
} }
while( this->next->next != NULL){ while( this->next->next != NULL){
if(strcmp(this->value, target) == 0){ if(strcmp(this->value, target) == 0){
free(this->next); free(this->next);
this->next = this->next->next; this->next = this->next->next;
return first; return this;
} }
else { else {
this = this->next; this = this->next;
} }
} }
return first; return this;
} }