Fixing error

This commit is contained in:
Anton Dolozin 2025-11-04 23:53:41 +01:00
parent 7b92a826ba
commit 7d0ceca38e

View File

@ -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;