cv6
This commit is contained in:
parent
2bb996b323
commit
4253b35109
@ -2,7 +2,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#define SIZE 37
|
||||
|
||||
|
||||
struct station* create_station(){
|
||||
struct station* station = (struct station*)calloc(1,sizeof(struct station));
|
||||
@ -53,8 +53,8 @@ void add_target_capacity(struct station* station, const char* target, int capaci
|
||||
|
||||
struct car* new_car = (struct car*)malloc(sizeof(struct car));
|
||||
new_car->capacity = capacity;
|
||||
strncpy(new_car->value, target, SIZE - 1);
|
||||
new_car->value[SIZE - 1] = '\0';
|
||||
strncpy(new_car->value, target, TARGET_SIZE - 1);
|
||||
new_car->value[TARGET_SIZE - 1] = '\0';
|
||||
new_car->next = station->tracks[track];
|
||||
station->tracks[track] = new_car;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user