[Xcb] [PATCH] Initialize all fields of addrinfo and use #ifdef
Julien Cristau
jcristau at debian.org
Thu Aug 28 04:58:18 PDT 2008
On Wed, Aug 27, 2008 at 09:34:40 -0700, Barton C Massey wrote:
>
> The memset() here seems like it could potentially mask a
> bug. Initializing unknown extra fields to zero seems
> scary---better to leave them uninitialized and hope the
> compiler or valgrind can notice and warn. Am I missing
> something?
>
The getaddrinfo(3) manpage only documents the settings for ai_family,
ai_socktype, ai_protocol and ai_flags, and says "All the other fields in
the structure pointed to by hints must contain either 0 or a null
pointer, as appropriate". The patch looks correct to me.
Cheers,
Julien
More information about the Xcb
mailing list