summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2020-05-20 20:23:42 +0200
committerLeah Neukirchen <leah@vuxu.org>2020-05-20 20:23:42 +0200
commit894ada34f43c1a12c3ad1c5f8c4d2c47356d912a (patch)
tree101058faac20c22c019360d19bc5f7193f5be84b
parentd823b09d9a68368459ad598d8bd8413a751950f2 (diff)
downloadhittpd-894ada34f43c1a12c3ad1c5f8c4d2c47356d912a.tar.gz
hittpd-894ada34f43c1a12c3ad1c5f8c4d2c47356d912a.tar.xz
hittpd-894ada34f43c1a12c3ad1c5f8c4d2c47356d912a.zip
remove double casting via (void *)
-rw-r--r--hittpd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/hittpd.c b/hittpd.c
index 16d8e0e..a9ead14 100644
--- a/hittpd.c
+++ b/hittpd.c
@@ -227,9 +227,9 @@ peername(int fd)
 	socklen_t slen = sizeof ss;
 	static char addrbuf[NI_MAXHOST];
 
-	if (getpeername(fd, (struct sockaddr *)(void *)&ss, &slen) < 0)
+	if (getpeername(fd, (struct sockaddr *)&ss, &slen) < 0)
 		return "0.0.0.0";
-	if (getnameinfo((struct sockaddr *)(void *)&ss, slen,
+	if (getnameinfo((struct sockaddr *)&ss, slen,
 	    addrbuf, sizeof addrbuf, 0, 0, NI_NUMERICHOST) < 0)
 		return "0.0.0.0";
 
@@ -1006,9 +1006,8 @@ main(int argc, char *argv[])
 		char portbuf[PATH_MAX] = "(unknown)";
 		struct sockaddr_storage ss;
 		socklen_t slen = sizeof ss;
-		if (getsockname(listenfd,
-		    (struct sockaddr *)(void *)&ss, &slen) == 0 &&
-		    getnameinfo((struct sockaddr *)(void *)&ss, slen,
+		if (getsockname(listenfd, (struct sockaddr *)&ss, &slen) == 0 &&
+		    getnameinfo((struct sockaddr *)&ss, slen,
 		    addrbuf, sizeof addrbuf, portbuf, sizeof portbuf,
 		    NI_NUMERICHOST | NI_NUMERICSERV) == 0)
 			addr = addrbuf;