From 5a7a4baf9b0ec19abba48fda8783cd403ef6207e Mon Sep 17 00:00:00 2001 From: nova Date: Thu, 8 May 2025 21:16:03 +0200 Subject: [PATCH] fixed a bug where trash data may appear --- threading.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/threading.c b/threading.c index 6bd5a88..40ffa6c 100644 --- a/threading.c +++ b/threading.c @@ -45,6 +45,7 @@ void *thread_mid(void *data){ mid_file_count = (unsigned long)get_dir_size(path); mid_content = malloc(mid_file_count * sizeof(file)); + memset(mid_content, ' ', mid_file_count * sizeof(file)); get_dir_content(path, &mid_file_count, mid_content); } @@ -74,6 +75,7 @@ void *thread_lft(void *data){ lft_file_count = (unsigned long)get_dir_size(parent); lft_content = malloc(lft_file_count * sizeof(file)); + memset(lft_content, ' ', lft_file_count * sizeof(file)); get_dir_content(parent, &lft_file_count, lft_content); free(parent);