Cliff Woolley <[EMAIL PROTECTED]> writes:

> On Sun, 22 Jul 2001, Ryan Bloom wrote:
> 
> > I dislike hard-coding the length, because it makes it less obvious
> > that we are talking about the length of the string.  Since we are
> > using sizeof, and especially since we have hard-coded the string in
> > the sizeof, any decent compiler will optimize this to the hard-coded
> > value anyway, so the performance benefit really shouldn't exist.
> 
> Agreed.
> 
> >  I will fix the bug by just using sizeof("(none)") in the code and
> > commit today.  Also, C++ comments can really mess up some C compilers.
> > In the future, please only use C style comments.  Great catch!
> 
> Shouldn't it be (sizeof("(none)") - 1)?  It's the length of the data
> itself that we care about here, not counting the null terminator.
> [sizeof("(none)") == 7, right?]

YES (fix it already :) )

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...

Reply via email to