]> thyrsus.com Git - comparator.git/commitdiff
Fix a range to avoid a core dump.
authorEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 15:23:34 +0000 (15:23 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 14 Sep 2003 15:23:34 +0000 (15:23 +0000)
report.c

index 56a45b8fbbd76c7e375b274f060911d177a898ab..340970a5f7eff711dcb5325547d691622bea3245 100644 (file)
--- a/report.c
+++ b/report.c
@@ -135,7 +135,7 @@ static int collapse_ranges(struct match_t *reduced, int nonuniques)
 
      /* time to merge overlapping shreds */
      for (sp = reduced; sp < reduced + nonuniques; sp++)
-        for (tp = sp + 1; !compare_files(sp, tp); tp++)
+        for (tp = sp + 1; !compare_files(sp, tp) && tp < reduced + nonuniques; tp++)
         {
 #ifdef DEBUG
             printf("Trying merge of %d into %d\n", tp-reduced, sp-reduced);