FW: [ircd-ratbox] Minor Patch

Bill Bierman bill at mu.org
Thu Jun 3 13:21:27 EDT 2004


Ooops, sent this to him rather than the list.

> > -----Original Message-----
> > From: ircd-ratbox-bounces at lists.ratbox.org [mailto:ircd-ratbox-
> > bounces at lists.ratbox.org] On Behalf Of Dustin Marquess
> > Sent: Thursday, June 03, 2004 9:24 AM
> > To: ircd-ratbox at lists.ratbox.org
> > Subject: Re: [ircd-ratbox] Minor Patch
> >
> > Ack! Ignore this. It makes logical sense to me, but it completely
> > borked my ircd. I'll try to figure out why..
> 
> For one thing, the comparison in C/C++ for equals is not '=' it is '=='.
> 
> See below..
> 
> <snip>
> 
> > >  	/* Catch idiotic requests up front */
> > > -	if((elemsize <= 0) || (elemsperblock <= 0))
> > > +	if((elemsize = 0) || (elemsperblock <= 0))
> 
> if((elements == 0) || (elemsperblock == 0))
> 
> <snip>
> 
> > > -	if(dlink_list_length(&chptr->members) <= 0)
> > > +	if(dlink_list_length(&chptr->members) = 0)
> 
> if(dlink_list_length(&chptr->members) == 0)
> 
> And so on and so on.
> 
> I should point out, though, that a <= comparison is no more intensive than
> ==.  In fact, with today's optimizing compilers, this change might be made
> by the compiler anyway.
> 
> Bill

--

William Alexander Bierman III

"How is this hate so deep, to lead us all so blindly killing?  Fools are we.
 If hate's the gate to peace, this is the last stop.  War: the only way to
 peace?  I don't fall for that.  You're righteous, so righteous, you're
 always so right.  Here there is more than's showing up, and I hope we can
 break it down so it's not so black and white."

    -- Dave Matthews




More information about the ircd-ratbox mailing list