From 681d5daa473167c51db6c69f6b0c18592bdaaf80 Mon Sep 17 00:00:00 2001 From: SowinskiBraeden Date: Tue, 15 Oct 2024 08:52:59 -0700 Subject: [PATCH] correctly allocate string array --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 533155d..a905449 100644 --- a/src/main.c +++ b/src/main.c @@ -75,7 +75,7 @@ TIMETABLE generateTimetable(STUDENT *students, size_t size_students, COURSE *cou /*** STEP 1 - Tally requests to check which courses are eligable to run ***/ - char **activeCourses = malloc(MAX_CLASSES * sizeof(char*)); + char **activeCourses = malloc(MAX_CLASSES * sizeof(char *)); uint16_t *activeCoursesIndexes = malloc(MAX_CLASSES * sizeof(uint16_t)); uint16_t activeCoursesLen = 0; // also acts as the length of activeCourses for (size_t i = 0; i < size_students; i++) {