Aktualizovat du6/a_station.c

This commit is contained in:
Tomáš Vlček 2026-04-23 22:42:44 +00:00
parent 9bb2e87a4f
commit 470e84b78e

View File

@ -27,7 +27,7 @@ void destroy_station(struct station* station)
free(tempTrack);
}
}
//uvolnenie vrchnych prvkov..
//uvolnenie pamate vrchnych prvkov/'nodeov'..
free(station->tracks);
free(station);
}
@ -65,7 +65,7 @@ void add_target_capacity(struct station* station,const char* target, int capacit
//Pocas iteracie porovna pole s cielovou stanicou pre aktualny smernik/pointer (current->value) versus vstupny argument 'target'
while (current != NULL)
{
if (strcmp(current->value, target))
if (strcmp(current->value, target == 0))
{
current->capacity += capacity;
return;
@ -125,6 +125,7 @@ int count_capacity(struct station* station){
{
//skontroluje individualne ich int 'capacity' pole a inkrementuje do vysledneho poctu
count += currentTracks->capacity;
currentTracks = currentTracks->next;
}
}
return count;