]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - winnet.c
Yet more global-removal. The static variables in logging.c are now
[PuTTY.git] / winnet.c
index 5b853e109236ce38f265bfced9c6478d6f5e1c2a..4ea29038623b6e2b3612d64811a2735a890b312a 100644 (file)
--- a/winnet.c
+++ b/winnet.c
@@ -380,10 +380,10 @@ void sk_addrcopy(SockAddr addr, char *buf)
 #endif
        struct in_addr a;
        a.s_addr = htonl(addr->address);
-       strncpy(buf, (char*) &a.s_addr, 4);
+       memcpy(buf, (char*) &a.s_addr, 4);
 #ifdef IPV6
     } else {
-       strncpy(buf, (char*) addr->ai, 16);
+       memcpy(buf, (char*) addr->ai, 16);
     }
 #endif
 }
@@ -833,7 +833,9 @@ void try_send(Actual_Socket s)
                s->pending_error = err;
                return;
            } else {
-               logevent(winsock_error_string(err));
+               /* We're inside the Windows frontend here, so we know
+                * that the frontend handle is unnecessary. */
+               logevent(NULL, winsock_error_string(err));
                fatalbox("%s", winsock_error_string(err));
            }
        } else {
@@ -972,7 +974,9 @@ int select_result(WPARAM wParam, LPARAM lParam)
        if (ret <= 0) {
            char *str = (ret == 0 ? "Internal networking trouble" :
                         winsock_error_string(WSAGetLastError()));
-           logevent(str);
+           /* We're inside the Windows frontend here, so we know
+            * that the frontend handle is unnecessary. */
+           logevent(NULL, str);
            fatalbox("%s", str);
        } else {
            return plug_receive(s->plug, 2, buf, ret);