Изменил(а) на 'cv4/a_train.c'
This commit is contained in:
parent
17d470750c
commit
e0089afd76
@ -43,9 +43,10 @@ void cancel_train(struct car* first){
|
|||||||
|
|
||||||
while(next != NULL){
|
while(next != NULL){
|
||||||
next = temp->next;
|
next = temp->next;
|
||||||
free(temp);
|
|
||||||
temp = next;
|
temp = next;
|
||||||
}
|
}
|
||||||
|
free(temp);
|
||||||
|
|
||||||
first = NULL;
|
first = NULL;
|
||||||
}
|
}
|
||||||
@ -60,11 +61,12 @@ struct car* clear_train(struct car* first, const char* target){
|
|||||||
while(temp != NULL){
|
while(temp != NULL){
|
||||||
next = temp->next;
|
next = temp->next;
|
||||||
if(!strcmp(temp->value, target))
|
if(!strcmp(temp->value, target))
|
||||||
free(temp);
|
|
||||||
temp = next;
|
temp = next;
|
||||||
if(!first)
|
if(!first)
|
||||||
first = temp;
|
first = temp;
|
||||||
}
|
}
|
||||||
|
free(temp);
|
||||||
|
|
||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user