From bd7029a99b0c2974265c6665638ef14a052f42ab Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Tue, 12 Feb 2008 11:07:18 +0000 Subject: Sync to latest Gnulib git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1925 f882894a-f735-0410-b71e-b25c423dba1c --- gl/getaddrinfo.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gl/getaddrinfo.c') diff --git a/gl/getaddrinfo.c b/gl/getaddrinfo.c index f523f765..04f0ac2e 100644 --- a/gl/getaddrinfo.c +++ b/gl/getaddrinfo.c @@ -1,11 +1,11 @@ /* Get address information (partial implementation). - Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software + Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Simon Josefsson . This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -28,9 +28,12 @@ /* Get calloc. */ #include -/* Get memcpy. */ +/* Get memcpy, strdup. */ #include +/* Get snprintf. */ +#include + #include #include "gettext.h" @@ -38,8 +41,6 @@ #define N_(String) String #include "inet_ntop.h" -#include "snprintf.h" -#include "strdup.h" /* BeOS has AF_INET, but not PF_INET. */ #ifndef PF_INET @@ -178,7 +179,7 @@ getaddrinfo (const char *restrict nodename, const char *proto = (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp"; - if (!(hints->ai_flags & AI_NUMERICSERV)) + if (hints == NULL || !(hints->ai_flags & AI_NUMERICSERV)) /* FIXME: Use getservbyname_r if available. */ se = getservbyname (servname, proto); -- cgit v1.2.3-74-g34f1