fixed a bug where trash data may appear

This commit is contained in:
nova 2025-05-08 21:16:03 +02:00
parent 6f7415a913
commit 5a7a4baf9b

View File

@ -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);