From c3d772b68e007a225483e76ee5f40293b60c79a0 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Thu, 2 Oct 2025 09:53:07 +0200 Subject: [PATCH] change direct init vars --- src/main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/main.c b/src/main.c index 6a6d2c8..604c2d0 100644 --- a/src/main.c +++ b/src/main.c @@ -10,15 +10,11 @@ void rename_files(const char* dir_path, rename_func_ptr renamefunc) { glob_t* files = malloc(sizeof(glob_t)); struct stat* statbuf = malloc(sizeof(struct stat)); - char* pattern = NULL; - char* input_filename = NULL; - char* output_filename = NULL; - - pattern = malloc(sizeof(char) * strlen(dir_path) + 3); - input_filename = malloc(sizeof(char) * STR_MAX_LENGTH); - output_filename = malloc(sizeof(char) * STR_MAX_LENGTH); + char* pattern = malloc(sizeof(char) * strlen(dir_path) + 3); + char* input_filename = malloc(sizeof(char) * STR_MAX_LENGTH); memset(input_filename, 0, STR_MAX_LENGTH); + char* output_filename = malloc(sizeof(char) * STR_MAX_LENGTH); memset(output_filename, 0, STR_MAX_LENGTH); sprintf(pattern, "%s/*", dir_path); -- 2.47.3