]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - winnet.c
Fix bug in the alternative code for -DNO_MULTIMON (was breaking
[PuTTY.git] / winnet.c
index 991443adb0d5889bed051f8e553462372418a017..0dac18e22728269b347fb579f5b4d48a3c3c3cef 100644 (file)
--- a/winnet.c
+++ b/winnet.c
@@ -124,6 +124,18 @@ void sk_init(void)
     sktree = newtree234(cmpfortree);
 }
 
+void sk_cleanup(void)
+{
+    Actual_Socket s;
+    int i;
+
+    if (sktree) {
+       for (i = 0; (s = index234(sktree, i)) != NULL; i++) {
+           closesocket(s->s);
+       }
+    }
+}
+
 char *winsock_error_string(int error)
 {
     switch (error) {
@@ -969,7 +981,7 @@ int select_result(WPARAM wParam, LPARAM lParam)
 
            memset(&isa, 0, sizeof(struct sockaddr_in));
            err = 0;
-           t = accept(s->s,&isa,&addrlen);
+           t = accept(s->s,(struct sockaddr *)&isa,&addrlen);
            if (t == INVALID_SOCKET)
            {
                err = WSAGetLastError();