[Toybox] [PATCH] netcat.c - cast &address

Nathan McSween nwmcsween at gmail.com
Fri Feb 17 01:27:13 PST 2012


# HG changeset patch
# User Nathan McSween <nwmcsween at gmail.com>
# Date 1329470827 0
# Node ID 2747a584395919fb401bf934cfac57e26fc36501
# Parent  2d8c6937b6a7fc68254a01fa5e4ef983db706dc8
netcat.c - cast &address

diff -r 2d8c6937b6a7 -r 2747a5843959 toys/netcat.c
--- a/toys/netcat.c	Fri Feb 17 09:14:17 2012 +0000
+++ b/toys/netcat.c	Fri Feb 17 09:27:07 2012 +0000
@@ -122,7 +122,7 @@
 			address.sin_port = SWAP_BE16(TT.port);
 			if (TT.source_address) 
 				lookup_name(TT.source_address, (uint32_t *)&address.sin_addr);
-			if (bind(sockfd, &address, sizeof(address)))
+			if (bind(sockfd, (struct sockaddr *)&address, sizeof(address)))
 				perror_exit("bind");
 		}
 
@@ -143,7 +143,7 @@
 
 			if (listen(sockfd, 5)) error_exit("listen");
 			if (!TT.port) {
-				getsockname(sockfd, &address, &len);
+				getsockname(sockfd, (struct sockaddr *)&address, &len);
 				printf("%d\n", SWAP_BE16(address.sin_port));
 				fflush(stdout);
 			}


More information about the Toybox mailing list