Commit 280e36a5 authored by Jakub Adam's avatar Jakub Adam

stunbdc: initialize Winsock API when on Windows

parent 602d48c4
...@@ -130,6 +130,12 @@ int main (int argc, char *argv[]) ...@@ -130,6 +130,12 @@ int main (int argc, char *argv[])
const char *server = NULL, *port = NULL; const char *server = NULL, *port = NULL;
int family = AF_UNSPEC; int family = AF_UNSPEC;
int i; int i;
int result;
#ifdef _WIN32
WSADATA w;
WSAStartup (0x0202, &w);
#endif
for (i = 1; i < argc; ++i) for (i = 1; i < argc; ++i)
{ {
...@@ -182,5 +188,11 @@ int main (int argc, char *argv[]) ...@@ -182,5 +188,11 @@ int main (int argc, char *argv[])
return 2; return 2;
} }
return run (family, server, port) ? 1 : 0; result = run (family, server, port) ? 1 : 0;
#ifdef _WIN32
WSACleanup();
#endif
return result;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment