clear
This commit is contained in:
parent
bd7d9eedb8
commit
22b91c853b
@ -74,16 +74,12 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
struct car* prev = first;
|
struct car* this = first;
|
||||||
while(prev->next->next != NULL){
|
while(this != NULL){
|
||||||
x = strcmp(prev->next->value, target);
|
if(this->value == target){
|
||||||
if(x == 0){
|
return 0;
|
||||||
struct car* third = prev->next->next;
|
|
||||||
free(prev->next);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
prev = prev->next;
|
this = this->next;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return first;
|
return first;
|
||||||
|
Loading…
Reference in New Issue
Block a user