From: Bastian Dehn Date: Thu, 2 Oct 2025 07:53:07 +0000 (+0200) Subject: change direct init vars X-Git-Tag: 1.1.1^2~7 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=c3d772b68e007a225483e76ee5f40293b60c79a0;p=mv_none_space.git change direct init vars --- 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);