Still fixing adding error
This commit is contained in:
parent
90bc2f4090
commit
058fae71a2
@ -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));
|
struct car* next = (struct car*)calloc(1, sizeof(struct car));
|
||||||
strcpy(next->value, target);
|
strcpy(next->value, target);
|
||||||
next->capacity = capacity;
|
next->capacity = capacity;
|
||||||
ptr->next = next;
|
if(ptr){
|
||||||
return;
|
ptr->next = next;
|
||||||
|
return;}
|
||||||
|
else{
|
||||||
|
*station->tracks = next;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
int new_cap = ptr->capacity + capacity;
|
int new_cap = ptr->capacity + capacity;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user