From b3d9bdba7605297c793d4aefdfa240a9da240ad5 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Tue, 9 Mar 2010 18:42:21 +0100 Subject: [PATCH] Added the include of sys/param.h to compile on FreeBSD. --- finddup.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); -- 2.20.1