From 75a53596aff9a5b29a808b7f29dfc80925d2627c Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 18 Oct 2018 07:43:22 +0200 Subject: [PATCH] Fixed a crashing bug There was a segfault generating bug when estimating the maximum group size in exec_command. --- finddup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finddup.c b/finddup.c index 6f6af38..7f22313 100644 --- a/finddup.c +++ b/finddup.c @@ -337,7 +337,7 @@ void exec_command(int nb, struct file_node **nodes) { pid_t pid; for(n = 0; n < nb; n++) { - if(nodes[n]->group_id != nodes[n-1]->group_id) { + if(n > 0 && nodes[n]->group_id != nodes[n-1]->group_id) { group_size = 0; } group_size++; -- 2.20.1