#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
}
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 {
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);