fix WSAStartup() error case
Stefan Schuermans

Stefan Schuermans commited on 2017-10-28 22:57:32
Showing 1 changed files, with 3 additions and 2 deletions.

... ...
@@ -25,9 +25,10 @@ PlatformInit::PlatformInit()
25 25
     exit(1);
26 26
   }
27 27
   if (LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
28
+    WSACleanup();
28 29
     std::cerr << "WSAStartup((2, 2), ...) returned ("
29
-              << LOBYTE(wsaData.wVersion) << ", "
30
-              << HIBYTE(wsaData.wVersion) << ")" << std::endl;
30
+              << (WORD)LOBYTE(wsaData.wVersion) << ", "
31
+              << (WORD)HIBYTE(wsaData.wVersion) << ")" << std::endl;
31 32
     exit(1);
32 33
   }
33 34
 }
34 35