From 4253b35109a255acb17981191b240078210b2ad4 Mon Sep 17 00:00:00 2001 From: Bohdan Kapliuk Date: Sun, 3 Nov 2024 19:58:47 +0200 Subject: [PATCH] cv6 --- cv6/a_station.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; }