[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [leafnode-list] [ANNOUNCE] First Leafnode-2.0 beta version
On Fri, Oct 27, 2000 at 07:46:36PM +0200, Cornelius Krasel wrote:
> Joerg Dietrich wrote:
> > Isn't the overview we read from disk overwritten by
> >
> > memset( xoverinfo, 0, sizeof(struct xoverinfo) * (xcount+current+1) );
> >
> > which occurs earlier?
>
> No. The overview file is read into a buffer called "overview" and
Ok.
> > You forgot the rest :-) If the article is new, i.e. not present
> > in the .overview on disk, the new overview line is generated and
> > added to the xoverview array. From now on the array is unsorted
> > and calling findxover() is pointless.
>
> Are you sure? findxover() searches only through "xcount" members
> of the array; if there are additional entries behind that, these
> are not considered. xcount is only changed at the very end of the
> function.
Yes, but current is set back to zero in line 316. And
if ( art > xlast || art < xfirst )
update = 1;
else if ( xoverinfo[current].text ) {
xoverinfo[current].text = p; /* leak memory */
xoverinfo[current].exists = 0;
xoverinfo[current].artno = art;
current++;
}
else {
xoverinfo[current].exists = 0;
xoverinfo[current].text = p;
xoverinfo[current].artno = art;
current++;
}
doesn't increase it again if the first condition is true. So if
xcount == current in the beginning, current may now be smaller
than xcount and new posting will be in the raange checked by
findxover().
Regards,
Jo:rg
--
Fortune cookie of the day:
One family builds a wall, two families enjoy it.
--
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list