From: Francois Fleuret Date: Thu, 18 Oct 2018 05:43:22 +0000 (+0200) Subject: Fixed a crashing bug X-Git-Url: https://www.fleuret.org/cgi-bin/gitweb/gitweb.cgi?p=finddup.git;a=commitdiff_plain;h=75a53596aff9a5b29a808b7f29dfc80925d2627c Fixed a crashing bug There was a segfault generating bug when estimating the maximum group size in exec_command. --- 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++;