From 4cae57030f91a4b9d3b6b05c21dacbc776974c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Vl=C4=8Dek?= Date: Thu, 23 Apr 2026 22:32:57 +0000 Subject: [PATCH] Aktualizovat du6/a_station.c --- du6/a_station.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/du6/a_station.c b/du6/a_station.c index be738ec..c3b73f8 100644 --- a/du6/a_station.c +++ b/du6/a_station.c @@ -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)