This commit is contained in:
Maryna Kravtsova 2020-11-02 15:45:13 +01:00
parent 5202a7ff7f
commit 6e024061ef

View File

@ -13,10 +13,10 @@ struct car* add_car(struct car* first,const char* target) {
} }
if(first == NULL){ if(first == NULL){
strcpy(newcar->value, target);
return newcar; return newcar;
} }
strcpy(newcar->value, target); strcpy(newcar->value,target);
struct car *this = first; struct car *this = first;
while(this->next != NULL){ while(this->next != NULL){
this = this->next; this = this->next;