FIX: Core dump on failed name lookup.
This commit is contained in:
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include "global.h" // StepMania only includes
|
#include "global.h" // StepMania only includes
|
||||||
|
|
||||||
|
|
||||||
#if defined(_XBOX)
|
#if defined(_XBOX)
|
||||||
#elif defined(_WINDOWS) // We need the WinSock32 Library on Windows
|
#elif defined(_WINDOWS) // We need the WinSock32 Library on Windows
|
||||||
#pragma comment(lib,"wsock32.lib")
|
#pragma comment(lib,"wsock32.lib")
|
||||||
@@ -159,6 +158,8 @@ bool EzSockets::connect(const std::string& host,unsigned short port)
|
|||||||
#elif defined(_WINDOWS)
|
#elif defined(_WINDOWS)
|
||||||
struct hostent* phe;
|
struct hostent* phe;
|
||||||
phe = gethostbyname(host.c_str());
|
phe = gethostbyname(host.c_str());
|
||||||
|
if (phe == NULL)
|
||||||
|
return false;
|
||||||
addr.sin_addr = *((LPIN_ADDR)* phe->h_addr_list);
|
addr.sin_addr = *((LPIN_ADDR)* phe->h_addr_list);
|
||||||
#else
|
#else
|
||||||
inet_pton(AF_INET,host.c_str(), &addr.sin_addr);
|
inet_pton(AF_INET,host.c_str(), &addr.sin_addr);
|
||||||
|
|||||||
Reference in New Issue
Block a user