diff --git a/cv6/a_station.c b/cv6/a_station.c index e6df663..f308de5 100644 --- a/cv6/a_station.c +++ b/cv6/a_station.c @@ -2,7 +2,7 @@ #include #include #include -#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; }