From 76fd2153a9beabad29317cbb4330a2803ad036e4 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Fri, 9 Feb 2024 15:46:33 +0100 Subject: [PATCH] nullterm after strncpy great function thanks glibc --- modfetch.c | 1 + 1 file changed, 1 insertion(+) diff --git a/modfetch.c b/modfetch.c index dfd6d3e..5a481e1 100644 --- a/modfetch.c +++ b/modfetch.c @@ -159,6 +159,7 @@ Config parse_config(FILE *config_file) { in_config = true; // get rid of the '{' strncpy(current_path, line, (size_t)read - 2); + current_path[read - 2] = '\0'; current_module.path = process_str(current_path); current_module.config = malloc(INITIAL_CONFIG_SIZE * sizeof(char*));