Fixed a crashing bug
[finddup.git] / finddup.c
index 2e4a937..7f22313 100644 (file)
--- a/finddup.c
+++ b/finddup.c
@@ -23,9 +23,9 @@
  *
  */
 
-#define VERSION_NUMBER "1.2"
+#define VERSION_NUMBER "1.2.1"
 
-#define _BSD_SOURCE
+#define _DEFAULT_SOURCE
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -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++;