Aktualizovat du6/a_station.c
This commit is contained in:
parent
09e936a1b7
commit
4cae57030f
@ -20,7 +20,7 @@ void destroy_station(struct station* station)
|
||||
for (int i = 0; i < station->track_count; i++)
|
||||
{
|
||||
struct car* currentTracks = station->tracks[i];
|
||||
while (currentTracks->next != NULL)
|
||||
while (currentTracks != NULL)
|
||||
{
|
||||
struct car* tempTrack = currentTracks;
|
||||
currentTracks = currentTracks->next;
|
||||
@ -78,8 +78,8 @@ void add_target_capacity(struct station* station,const char* target, int capacit
|
||||
newCar->capacity = capacity;
|
||||
|
||||
//vlozi na zaciatok tracku
|
||||
new_car->next = station->tracks[i];
|
||||
station->tracks[i] = new_car;
|
||||
newCar->next = station->tracks[i];
|
||||
station->tracks[i] = newCar;
|
||||
}
|
||||
|
||||
int get_target_capacity(struct station* station,const char* target)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user