Fixing error
This commit is contained in:
parent
7b92a826ba
commit
7d0ceca38e
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user