Aktualizovat du6/a_station.c

This commit is contained in:
Tomáš Vlček 2026-04-23 22:44:19 +00:00
parent 470e84b78e
commit 1d691c60c9

View File

@ -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 == 0))
if (strcmp(current->value, target) == 0)
{
current->capacity += capacity;
return;
@ -86,7 +86,7 @@ void add_target_capacity(struct station* station,const char* target, int capacit
int get_target_capacity(struct station* station,const char* target)
{
for (int i = 0; i < station->track_count, i++)
for (int i = 0; i < station->track_count; i++)
{
struct car* currentTracks = station->tracks[i];
while (currentTracks->next != NULL)
@ -104,7 +104,7 @@ int get_target_capacity(struct station* station,const char* target)
int count_targets(struct station* station)
{
int count = 0;
for (int i = 0; i < station->track_count, i++)
for (int i = 0; i < station->track_count; i++)
{
struct car* currentTracks = station->tracks[i];
while (currentTracks->next->value != NULL && currentTracks->next != NULL)
@ -118,7 +118,7 @@ int count_targets(struct station* station)
int count_capacity(struct station* station){
int count = 0;
for (int i = 0; i < station->track_count, i++)
for (int i = 0; i < station->track_count; i++)
{
struct car* currentTracks = station->tracks[i];
while (currentTracks->next != NULL)