Replaced BUFFER_SIZE with PATH_MAX where it makes sense.
authorFrancois Fleuret <francois@fleuret.org>
Sun, 7 Mar 2010 16:52:40 +0000 (17:52 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Sun, 7 Mar 2010 16:52:40 +0000 (17:52 +0100)
dus.c

diff --git a/dus.c b/dus.c
index 6e39dca..c391784 100644 (file)
--- 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);
       }
     }