From 054abc1c6c091414c49ce18a88de51d6dd1a276d Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 25 Feb 2010 22:09:45 +0100 Subject: [PATCH] Changed the buffer size, added the setlocale. --- dus.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dus.c b/dus.c index 5b19766..338b69b 100644 --- a/dus.c +++ b/dus.c @@ -34,10 +34,12 @@ #include #include -#define BUFFER_SIZE 1024 +#define BUFFER_SIZE 4096 typedef int64_t size_sum_t; +/********************************************************************/ + size_sum_t file_or_dir_size(char *name) { DIR *dir; struct dirent *dir_e; @@ -121,7 +123,6 @@ int compare_files(const void *x1, const void *x2) { } } - void print_sorted(struct file_with_size *root, int height) { struct file_with_size *node; struct file_with_size **nodes; @@ -184,6 +185,8 @@ int main(int argc, char **argv) { root = 0; + setlocale (LC_ALL, ""); + if(argc > 1) { for(k = 1; k < argc; k++) { root = create(argv[k], root); -- 2.20.1