From 3ac07444f58b722d777829606522233e85cea4a9 Mon Sep 17 00:00:00 2001 From: Radovan Kofira Date: Thu, 5 Nov 2020 20:16:27 +0100 Subject: [PATCH] 17% --- cv5/a_train.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }