]> git.saurik.com Git - apple/security.git/blobdiff - sslViewer/ioSock.c
Security-59754.80.3.tar.gz
[apple/security.git] / sslViewer / ioSock.c
index 109c00cea241e1883a69fa0e17b178c033627031..562191146d3d287c3790f465dce601cbf74da67e 100644 (file)
@@ -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;
        
@@ -271,8 +271,6 @@ OSStatus ListenForClients(
                }
                return rtn;
     }
-       /* NOT REACHED */
-       return 0;
 }
 
 /*
@@ -346,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;
@@ -393,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 */