httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cliff Woolley <cliffwool...@yahoo.com>
Subject Re: [PATCH] version 2.0 / mod_include.c
Date Mon, 23 Jul 2001 02:38:44 GMT
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?]

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA



Mime
View raw message