From: Francois Fleuret Date: Tue, 9 Mar 2010 17:42:21 +0000 (+0100) Subject: Added the include of sys/param.h to compile on FreeBSD. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=b3d9bdba7605297c793d4aefdfa240a9da240ad5;p=finddup.git Added the include of sys/param.h to compile on FreeBSD. --- diff --git a/finddup.c b/finddup.c index 983168b..e36c229 100644 --- a/finddup.c +++ b/finddup.c @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -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);