Изменил(а) на 'cv4/a_train.c'

This commit is contained in:
Oleksandr Hryshchenko 2021-11-04 23:42:09 +00:00
parent 036b9fbe75
commit e08472fa25

View File

@ -4,12 +4,12 @@
#include "a_train.h" #include "a_train.h"
struct car* add_car(struct car* first, const char* target){ struct car* add_car(struct car* first, const char* target){
if(!strcmp(target, "") && !first) if(!strcmp(target, ""))
return NULL; return NULL;
struct car* temp = first; struct car* temp = first;
while(temp->next != NULL) while(temp != NULL)
temp = temp->next; temp = temp->next;
temp->next = (struct car*)calloc(1, sizeof(struct car)); temp->next = (struct car*)calloc(1, sizeof(struct car));