diff --git a/cv4/a_train.c b/cv4/a_train.c index 290ed95..db20e3a 100755 --- a/cv4/a_train.c +++ b/cv4/a_train.c @@ -40,6 +40,9 @@ void cancel_train(struct car* first) { struct car* clear_train(struct car* first, const char* target) { struct car* this = first; + if (this == NULL){ + return NULL; + } while( this->next->next != NULL){ if(strcmp(this->value, target) == 0){ this->next == this->next->next;