train
This commit is contained in:
parent
7bd7f9c076
commit
bd7d9eedb8
@ -45,7 +45,7 @@ void print_train(struct car* first) {
|
|||||||
|
|
||||||
void cancel_train(struct car* first) {
|
void cancel_train(struct car* first) {
|
||||||
if(first == NULL){
|
if(first == NULL){
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
if(first->next != NULL){
|
if(first->next != NULL){
|
||||||
cancel_train(first->next);
|
cancel_train(first->next);
|
||||||
@ -67,7 +67,7 @@ struct car* clear_train(struct car* first, const char* target) {
|
|||||||
}
|
}
|
||||||
int x;
|
int x;
|
||||||
if(first->next == NULL){
|
if(first->next == NULL){
|
||||||
x = strcmp(first->value; target);
|
x = strcmp(first->value, target);
|
||||||
if(x == 0){
|
if(x == 0){
|
||||||
free(first);
|
free(first);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user