From ad344b03ac4f6fd8d3bfec187240113432f6930d Mon Sep 17 00:00:00 2001 From: bjt-user Date: Tue, 9 Jul 2024 07:13:01 +0200 Subject: [PATCH] commented function, closed file --- src/main.c | 6 +++--- src/parse_ics.c | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index ed5638c..e20b5fd 100644 --- a/src/main.c +++ b/src/main.c @@ -12,15 +12,15 @@ int main(int argc, char **argv) { get_cli_args(argc, argv, &ics_path, &show_all_events); - // initialize linked list - struct event *head = NULL; - static char current_date[] = "xxxxxxxxTxxxxxx"; get_date(current_date); printf ("Current date and time: "); pretty_print_date_time(current_date); printf ("\n\n"); + // initialize linked list + struct event *head = NULL; + parse_ics_file(ics_path, &head); print_upcoming(head, current_date, show_all_events); diff --git a/src/parse_ics.c b/src/parse_ics.c index 5341be7..640e92b 100644 --- a/src/parse_ics.c +++ b/src/parse_ics.c @@ -72,6 +72,10 @@ void unfolding_string(char *folded_string, char *unfolded_string) { } } +/* this function takes the head of an empty initialized event list + * and the path to the ics file + * it will "fill" the list +*/ void parse_ics_file(char *file_path, struct event **head) { char my_event[8192] = ""; char unfolded_event[8192] = ""; @@ -93,4 +97,6 @@ void parse_ics_file(char *file_path, struct event **head) { } memset(my_event, '\0', sizeof(my_event)); } + + close(myfd); }