diff --git a/cv5/a_train.c b/cv5/a_train.c index cafa6dc..393240e 100644 --- a/cv5/a_train.c +++ b/cv5/a_train.c @@ -15,6 +15,7 @@ struct car* add_car(struct car* first,const char* target) { struct car* newcar = calloc(1,sizeof(struct car)); struct car* this=first; + strcpy(newcar->value, target); if(this==NULL){ return newcar; } @@ -22,7 +23,6 @@ struct car* add_car(struct car* first,const char* target) { this=this->next; } this->next = newcar; - strcpy(newcar->value, target); return first; }