fixed a bug where trash data may appear
This commit is contained in:
parent
6f7415a913
commit
5a7a4baf9b
@ -45,6 +45,7 @@ void *thread_mid(void *data){
|
|||||||
|
|
||||||
mid_file_count = (unsigned long)get_dir_size(path);
|
mid_file_count = (unsigned long)get_dir_size(path);
|
||||||
mid_content = malloc(mid_file_count * sizeof(file));
|
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);
|
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_file_count = (unsigned long)get_dir_size(parent);
|
||||||
lft_content = malloc(lft_file_count * sizeof(file));
|
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);
|
get_dir_content(parent, &lft_file_count, lft_content);
|
||||||
free(parent);
|
free(parent);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user