diff --git a/libft/includes/net.h b/libft/includes/net.h index b568ceba..553b5031 100644 --- a/libft/includes/net.h +++ b/libft/includes/net.h @@ -42,7 +42,7 @@ int host_format(struct sockaddr *addr); int create_server(int port, int backlog, char *protoname); int create_client(char *addr, int port, char *protoname); void listener(int domain, int sock, int proto, - void (*handler)(void *buf, int bytes, struct sockaddr_in *addr)); + void (*handler)(void *buf, int bytes, struct sockaddr *addr)); /* ** lazy framing diff --git a/libft/srcs/net/create_client.c b/libft/srcs/net/create_client.c index 5f5b8585..2fa1a1e4 100644 --- a/libft/srcs/net/create_client.c +++ b/libft/srcs/net/create_client.c @@ -30,10 +30,10 @@ int create_client(char *addr, int port, char *protoname) } void listener(int domain, int sock, int proto, - void (*handler)(void *buf, int bytes, struct sockaddr_in *addr)) + void (*handler)(void *buf, int bytes, struct sockaddr *addr)) { int sd; - struct sockaddr_in addr; + struct sockaddr addr; unsigned char buf[1024]; int bytes; socklen_t len; @@ -49,7 +49,7 @@ void listener(int domain, int sock, int proto, { bzero(buf, sizeof(buf)); bytes = recvfrom(sd, buf, sizeof(buf), 0, - (struct sockaddr*)&addr, &len); + &addr, &len); if (bytes > 0 && handler) handler(buf, bytes, &addr); else diff --git a/libft/srcs/time/epoch.c b/libft/srcs/time/epoch.c index 46f1184e..5e4deba4 100644 --- a/libft/srcs/time/epoch.c +++ b/libft/srcs/time/epoch.c @@ -27,5 +27,5 @@ double time_milli(void) if (gettimeofday(&tv, NULL)) return (0); - return ((double)((double)tv.tv_sec / 1000. + tv.tv_usec * 1000.)); + return ((double)(tv.tv_sec * 1000. + (double)tv.tv_usec / 1000.)); }