diff --git a/du5/a_station.c b/du5/a_station.c index ce4e013..9131237 100644 --- a/du5/a_station.c +++ b/du5/a_station.c @@ -56,6 +56,14 @@ void add_target_capacity(struct station* station,const char* target, int capacit return; } } + else if (count == res && strcmp(ptr->value, target) == 0){ + struct car* next = (struct car*)calloc(1, sizeof(struct car)); + strcpy(next->value, target); + next->capacity = capacity; + ptr->next = next; + return; + + } int new_cap = ptr->capacity + capacity; ptr->capacity = new_cap; return;