]> ruderich.org/simon Gitweb - socket2unix/socket2unix.git/commitdiff
Don't remove const qualifier in cast.
authorSimon Ruderich <simon@ruderich.org>
Mon, 2 Dec 2013 22:29:12 +0000 (23:29 +0100)
committerSimon Ruderich <simon@ruderich.org>
Mon, 2 Dec 2013 22:29:12 +0000 (23:29 +0100)
src/socket2unix.c

index 6f9f0c7955c7a37edb043c29788f00729a633322..27f8d6833e43cff6afe21a3c4c2f1c531c3b7412 100644 (file)
@@ -370,10 +370,10 @@ static int set_sockaddr_un(struct sockaddr_un *sockaddr,
     int port;
     if (addr->sa_family == AF_INET) {
         af   = "v4";
-        port = ntohs(((struct sockaddr_in *)addr)->sin_port);
+        port = ntohs(((const struct sockaddr_in *)addr)->sin_port);
     } else if (addr->sa_family == AF_INET6) {
         af   = "v6";
-        port = ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
+        port = ntohs(((const struct sockaddr_in6 *)addr)->sin6_port);
     } else {
         af   = "unknown";
         port = 0;