Still fixing adding error

This commit is contained in:
Anton Dolozin 2025-11-05 00:01:07 +01:00
parent 90bc2f4090
commit 058fae71a2

View File

@ -60,8 +60,14 @@ void add_target_capacity(struct station* station,const char* target, int capacit
struct car* next = (struct car*)calloc(1, sizeof(struct car));
strcpy(next->value, target);
next->capacity = capacity;
ptr->next = next;
return;
if(ptr){
ptr->next = next;
return;}
else{
*station->tracks = next;
return;
}
}
int new_cap = ptr->capacity + capacity;