diff --git a/cv5/a_train.c b/cv5/a_train.c index 570c209..b6d2b6a 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -11,6 +11,9 @@ struct car* add_car(struct car* first,const char* target) { if(first == NULL){ return newcar; } + if(target == NULL){ + return NULL; + } struct car *this = first; while(this->next != NULL){ this = this->next;