Bzero?  Is it an already-allocated array/byte sequence?  (Apologies, I haven't 
seen the code.)  Assignment to NULL/0 is in fact correct for initializing a 
sole pointer, and using bzero for that certainly isn't typical.  Also, for 
initializing a byte range, memset is preferred [see Linux BZERO(3), which 
refers to POSIX.1-2008 on that point].

STYLE(9) says use NULL rather than 0, and it is clearer.  But C/C++ programmers 
should know that NULL is 0.  And note that at least through 1998, 
initialization to 0 was the preferred style in C++, IIRC.

Matt

----- "Adrian Chadd" <[email protected]> wrote:

> I've just replied to the ticket in question. It should probably just
> be a bzero() rather than setting the pointer to 0. Which should
> really
> be setting it to NULL.
> 
> Anyway, please test whether the bzero() works. If it does then I'll
> commit that fix to HEAD and 2.7.
> 
> 2009/9/28 Jason Noble <[email protected]>:
> > I have opened a bug for this issue here:
> http://bugs.squid-cache.org/show_bug.cgi?id=2788  Also, the previous
> patch was not generated against head so I re-rolled the patch against
> current head and attached to the bug report

-- 

Matt Benjamin

The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI  48104

http://linuxbox.com

tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309

Reply via email to