X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/d8f41ccd20de16f8ebe2ccc84d47bf1cb2b26bbb..HEAD:/sslViewer/ioSock.c diff --git a/sslViewer/ioSock.c b/sslViewer/ioSock.c index 676cf2bc..56219114 100644 --- a/sslViewer/ioSock.c +++ b/sslViewer/ioSock.c @@ -146,7 +146,7 @@ OSStatus MakeServerConnection( PeerSpec *peer) // RETURNED { struct sockaddr_in addr; - struct hostent *ent; + struct hostent *ent = NULL; struct in_addr host; int sock = 0; @@ -179,7 +179,8 @@ OSStatus MakeServerConnection( addr.sin_family = AF_INET; if (connect(sock, (struct sockaddr *) &addr, sizeof(struct sockaddr_in)) != 0) - { printf("connect returned error\n"); + { + perror("connect returned error"); return errSecIO; } @@ -270,8 +271,6 @@ OSStatus ListenForClients( } return rtn; } - /* NOT REACHED */ - return 0; } /* @@ -345,7 +344,6 @@ OSStatus SocketRead( UInt8 *currData = (UInt8 *)data; int sock = (int)((long)connection); OSStatus rtn = errSecSuccess; - size_t bytesRead = 0; ssize_t rrtn; *dataLength = 0; @@ -392,9 +390,8 @@ OSStatus SocketRead( /* in any case, we're done with this call if rrtn <= 0 */ break; } - bytesRead = rrtn; - bytesToGo -= bytesRead; - currData += bytesRead; + bytesToGo -= rrtn; + currData += rrtn; if(bytesToGo == 0) { /* filled buffer with incoming data, done */