This commit is contained in:
Maryna Kravtsova 2020-11-02 15:38:02 +01:00
parent da2607343b
commit 082b004021

View File

@ -9,11 +9,10 @@ struct car* add_car(struct car* first,const char* target) {
if(target == NULL){ if(target == NULL){
return 0; return 0;
} }
struct car* newcar = calloc(1, sizeof(struct car));
if(first == NULL){ if(first == NULL){
return newcar; return newcar;
} }
struct car* newcar = calloc(1, sizeof(struct car));
strcpy(newcar->value, target); strcpy(newcar->value, target);
struct car *this = first; struct car *this = first;