This commit is contained in:
Radovan Kofira 2020-11-05 20:16:27 +01:00
parent faa298fa9e
commit 3ac07444f5

View File

@ -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;
}