mirror of
https://github.com/irssi/irssi.git
synced 2026-08-10 20:33:46 +02:00
net_gethostbyname_nonblock(): don't crash if net_gethosterror() returns
error message as NULL. Initialize winsock with win32. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@966 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
parent
4316840890
commit
346808789c
2 changed files with 20 additions and 3 deletions
|
|
@ -223,10 +223,27 @@ static void check_files(void)
|
|||
g_free(path);
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
static void winsock_init(void)
|
||||
{
|
||||
WORD wVersionRequested;
|
||||
WSADATA wsaData;
|
||||
|
||||
wVersionRequested = MAKEWORD(2, 2);
|
||||
|
||||
if (WSAStartup(wVersionRequested, &wsaData) != 0) {
|
||||
printf("Error initializing winsock\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
check_files();
|
||||
|
||||
#ifdef WIN32
|
||||
winsock_init();
|
||||
#endif
|
||||
#ifdef HAVE_SOCKS
|
||||
SOCKSinit(argv[0]);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue