From 49d8fa1058aaf23c29e074b2314492ae40d2f557 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 21 Feb 2017 12:05:07 +0000 Subject: Types change: big pass on libstddjb and libunixonacid libdatastruct still missing, library still not functional --- src/libstddjb/socket_local4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstddjb/socket_local4.c') diff --git a/src/libstddjb/socket_local4.c b/src/libstddjb/socket_local4.c index 90ae93a..60dcd9d 100644 --- a/src/libstddjb/socket_local4.c +++ b/src/libstddjb/socket_local4.c @@ -3,18 +3,18 @@ #include #include #include +#include +#include #include -#include #include -int socket_local4 (int s, char *ip, uint16 *port) +int socket_local4 (int s, char *ip, uint16_t *port) { struct sockaddr_in sa ; socklen_t dummy = sizeof sa ; - if (getsockname(s, (struct sockaddr *)&sa, &dummy) == -1) return -1 ; - byte_copy(ip, 4, (char *)&sa.sin_addr.s_addr) ; + memcpy(ip, &sa.sin_addr.s_addr, 4) ; uint16_unpack_big((char *)&sa.sin_port, port) ; return 0 ; } -- cgit v1.2.3