clear train

This commit is contained in:
Valér Jakubčo 2021-11-04 20:25:53 +01:00
parent b539c1c98a
commit 231059682f

View File

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