X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;ds=sidebyside;f=sbr%2Fseq_list.c;h=ce23c2240286b0e968a5a6009d2683c134e962e7;hb=HEAD;hp=f051e38bd7879bd7da6c16dcc6b54f2588752403;hpb=d3ba09a465cb0e5fc9a74d0b152a7ed965f895cb;p=mmh diff --git a/sbr/seq_list.c b/sbr/seq_list.c index f051e38..ce23c22 100644 --- a/sbr/seq_list.c +++ b/sbr/seq_list.c @@ -27,7 +27,7 @@ seq_list(struct msgs *mp, char *seqname) /* On first invocation, allocate initial buffer space */ if (!buffer) { len = MAXBUFFER; - buffer = mh_xmalloc((size_t) len); + buffer = mh_xcalloc(len, sizeof(char)); } /* @@ -54,12 +54,9 @@ seq_list(struct msgs *mp, char *seqname) bp = buffer; - for (i = mp->lowmsg; i <= mp->hghmsg; ++i) { - /* - ** If message doesn't exist, or isn't in - ** the sequence, then continue. - */ - if (!does_exist(mp, i) || !in_sequence(mp, seqnum, i)) + for (i = mp->lowoff; i <= mp->hghoff; ++i) { + /* If message isn't in the sequence, then continue */ + if (!in_sequence(mp, seqnum, i)) continue; /* @@ -72,7 +69,7 @@ seq_list(struct msgs *mp, char *seqname) char *newbuf; len += MAXBUFFER; - newbuf = mh_xrealloc(buffer, (size_t) len); + newbuf = mh_xrealloc(buffer, len); bp = newbuf + (bp - buffer); buffer = newbuf; } @@ -91,8 +88,7 @@ seq_list(struct msgs *mp, char *seqname) /* ** Scan to the end of this message range */ - for (++i; i <= mp->hghmsg && does_exist(mp, i) && in_sequence(mp, seqnum, i); - ++i) + for (++i; i <= mp->hghoff && in_sequence(mp, seqnum, i); ++i) ; if (i - j > 1) {