Added the include of sys/param.h to compile on FreeBSD.
authorFrancois Fleuret <francois@fleuret.org>
Tue, 9 Mar 2010 17:42:21 +0000 (18:42 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Tue, 9 Mar 2010 17:42:21 +0000 (18:42 +0100)
finddup.c

index 983168b..e36c229 100644 (file)
--- a/finddup.c
+++ b/finddup.c
@@ -29,6 +29,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/param.h>
 #include <dirent.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -196,7 +197,7 @@ struct file_with_size *scan_directory(struct file_with_size *tail,
   struct dirent *dir_e;
   struct stat sb;
   struct file_with_size *tmp;
-  char subname[PATH_MAX];
+  char subname[PATH_MAX + 1];
 
   if(lstat(name, &sb) != 0) {
     fprintf(stderr, "Can not stat \"%s\": %s\n", name, strerror(errno));
@@ -233,7 +234,7 @@ struct file_with_size *scan_directory(struct file_with_size *tail,
 }
 
 void print_file(struct file_with_size *node) {
-  char tmp[PATH_MAX];
+  char tmp[PATH_MAX + 1];
   if(show_realpaths) {
     if(show_groups) {
       realpath(node->filename, tmp);