aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSSHTunnel.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2011-03-08 01:08:32 +0000
committerrowanbeentje <rowan@beent.je>2011-03-08 01:08:32 +0000
commit2a9b0987450a7dd60e824a9067c8aa8fd3d1ee5c (patch)
treebc4d83fe70582142fea71fd2465da88ebe725fb4 /Source/SPSSHTunnel.m
parentcd06fc0c9c3713f12394a02f148158b4422b4aed (diff)
downloadsequelpro-2a9b0987450a7dd60e824a9067c8aa8fd3d1ee5c.tar.gz
sequelpro-2a9b0987450a7dd60e824a9067c8aa8fd3d1ee5c.tar.bz2
sequelpro-2a9b0987450a7dd60e824a9067c8aa8fd3d1ee5c.zip
Fix more compiler warnings, including a few bugs
Diffstat (limited to 'Source/SPSSHTunnel.m')
-rw-r--r--Source/SPSSHTunnel.m8
1 files changed, 4 insertions, 4 deletions
diff --git a/Source/SPSSHTunnel.m b/Source/SPSSHTunnel.m
index 16d0c590..d0464d59 100644
--- a/Source/SPSSHTunnel.m
+++ b/Source/SPSSHTunnel.m
@@ -245,15 +245,15 @@
// If no local port has yet been chosen, choose one
if (!localPort) {
- NSInteger tempSocket;
+ int tempSocket;
struct sockaddr_in tempSocketAddress;
- NSInteger addressLength = sizeof(tempSocketAddress);
+ size_t addressLength = sizeof(tempSocketAddress);
if((tempSocket = socket(AF_INET, SOCK_STREAM, 0)) > 0) {
memset(&tempSocketAddress, 0, sizeof(tempSocketAddress));
tempSocketAddress.sin_family = AF_INET;
tempSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY);
tempSocketAddress.sin_port = 0;
- if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, addressLength) >= 0) {
+ if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, (socklen_t)addressLength) >= 0) {
if (getsockname(tempSocket, (struct sockaddr *)&tempSocketAddress, (uint32_t *)&addressLength) >= 0) {
localPort = ntohs(tempSocketAddress.sin_port);
}
@@ -267,7 +267,7 @@
tempSocketAddress.sin_family = AF_INET;
tempSocketAddress.sin_addr.s_addr = htonl(INADDR_ANY);
tempSocketAddress.sin_port = 0;
- if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, addressLength) >= 0) {
+ if (bind(tempSocket, (struct sockaddr *)&tempSocketAddress, (socklen_t)addressLength) >= 0) {
if (getsockname(tempSocket, (struct sockaddr *)&tempSocketAddress, (uint32_t *)&addressLength) >= 0) {
localPortFallback = ntohs(tempSocketAddress.sin_port);
}