clear
This commit is contained in:
parent
0c8f1acd31
commit
3319922653
@ -69,6 +69,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
struct car* third = prev->next->next;
|
struct car* third = prev->next->next;
|
||||||
free(prev->next);
|
free(prev->next);
|
||||||
prev->next = third;
|
prev->next = third;
|
||||||
|
first->next = NULL;
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
prev = prev->next;
|
prev = prev->next;
|
||||||
@ -76,7 +77,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
int x = strcmp(prev->next->value, target);
|
int x = strcmp(prev->next->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
free(prev->next);
|
free(prev->next);
|
||||||
prev->next->next = NULL;
|
prev->next = NULL;
|
||||||
return first;
|
return first;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user