Ensure "reasonable" return values even if none of the #ifdef conditions in
wxGet{host,serv}by{name,addr}_r matches. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36873 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -235,7 +235,7 @@ struct hostent * wxGethostbyname_r(const char *hostname, struct hostent *h,
|
|||||||
void *buffer, int size, int *err)
|
void *buffer, int size, int *err)
|
||||||
|
|
||||||
{
|
{
|
||||||
struct hostent *he;
|
struct hostent *he = NULL;
|
||||||
*err = 0;
|
*err = 0;
|
||||||
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
||||||
if (gethostbyname_r(hostname, h, (char*)buffer, size, &he, err))
|
if (gethostbyname_r(hostname, h, (char*)buffer, size, &he, err))
|
||||||
@@ -268,7 +268,7 @@ struct hostent * wxGethostbyaddr_r(const char *addr_buf, int buf_size,
|
|||||||
int proto, struct hostent *h,
|
int proto, struct hostent *h,
|
||||||
void *buffer, int size, int *err)
|
void *buffer, int size, int *err)
|
||||||
{
|
{
|
||||||
struct hostent *he;
|
struct hostent *he = NULL;
|
||||||
*err = 0;
|
*err = 0;
|
||||||
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
#if defined(HAVE_FUNC_GETHOSTBYNAME_R_6)
|
||||||
if (gethostbyaddr_r(addr_buf, buf_size, proto, h,
|
if (gethostbyaddr_r(addr_buf, buf_size, proto, h,
|
||||||
@@ -338,7 +338,7 @@ static struct servent * deepCopyServent(struct servent *s,
|
|||||||
struct servent *wxGetservbyname_r(const char *port, const char *protocol,
|
struct servent *wxGetservbyname_r(const char *port, const char *protocol,
|
||||||
struct servent *serv, void *buffer, int size)
|
struct servent *serv, void *buffer, int size)
|
||||||
{
|
{
|
||||||
struct servent *se;
|
struct servent *se = NULL;
|
||||||
#if defined(HAVE_FUNC_GETSERVBYNAME_R_6)
|
#if defined(HAVE_FUNC_GETSERVBYNAME_R_6)
|
||||||
if (getservbyname_r(port, protocol, serv, (char*)buffer, size, &se))
|
if (getservbyname_r(port, protocol, serv, (char*)buffer, size, &se))
|
||||||
se = NULL;
|
se = NULL;
|
||||||
|
Reference in New Issue
Block a user