From: Francois Fleuret Date: Sun, 7 Mar 2010 16:52:40 +0000 (+0100) Subject: Replaced BUFFER_SIZE with PATH_MAX where it makes sense. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1a1b49f6bb461720ffe07be7ce24d870d5ccf59;p=dus.git Replaced BUFFER_SIZE with PATH_MAX where it makes sense. --- diff --git a/dus.c b/dus.c index 6e39dca..c391784 100644 --- a/dus.c +++ b/dus.c @@ -107,7 +107,7 @@ size_sum_t file_or_dir_size(const char *name) { struct dirent *dir_e; struct stat dummy; size_sum_t result; - char subname[BUFFER_SIZE]; + char subname[PATH_MAX]; result = 0; @@ -125,7 +125,7 @@ size_sum_t file_or_dir_size(const char *name) { if(dir) { while((dir_e = readdir(dir))) { if(!ignore_entry(dir_e->d_name)) { - snprintf(subname, BUFFER_SIZE, "%s/%s", name, dir_e->d_name); + snprintf(subname, PATH_MAX, "%s/%s", name, dir_e->d_name); result += file_or_dir_size(subname); } }