From: Eric S. Raymond Date: Wed, 17 Sep 2003 04:01:43 +0000 (+0000) Subject: Adjust the array length propery. X-Git-Tag: 2.0~29 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=9a434df1493afc3d97c12ea9a98f596d790ea239;p=comparator.git Adjust the array length propery. --- diff --git a/report.c b/report.c index ab14e21..867195a 100644 --- a/report.c +++ b/report.c @@ -357,8 +357,9 @@ void emit_report(struct sorthash_t *obarray, int hashcount) * Compact the match list in order to cut the n log n qsort time */ for (copy = match = hitlist; match < hitlist + hashcount; match++) - if (match->nmatches && copy < match) + if (match->nmatches > 0 && copy < match) *copy++ = *match; + mergecount = (copy - hitlist); qsort(hitlist, mergecount, sizeof(struct match_t), sortmatch); for (match = hitlist; match < hitlist + mergecount; match++)