code_str[ERR_CODE_LEN - 1] = '\0';
             }
         case netdb_error:
-            new_str = hstrerror(cc->err_code);
+            new_str = (char *) hstrerror(cc->err_code);
             if (new_str) {
                 strncpy(code_str, new_str,
                         ERR_CODE_LEN);
 
     X509_EXTENSION *ext = NULL;
     int i = 0;
     GENERAL_NAMES *ialt = NULL;
-    unsigned char *pBuffer = NULL;
+    char *pBuffer = NULL;
     int correspond = 0;
-    struct sockaddr *addr = NULL;
-    socklen_t addrlen = 0;
     X509_NAME *sn = NULL;
 
     /*if extensions are present, hostname has to correspond
     
     /* check the shutdown state*/
     ret = SSL_get_shutdown(ssl);
-    if (ret & SSL_SENT_SHUTDOWN)
+    if (ret & SSL_SENT_SHUTDOWN) {
         if (ret & SSL_RECEIVED_SHUTDOWN)
             return 1;
         else
             return 0;
+    }
     /* TODO check the proper states, maybe also call SSL_shutdown
     if (ret & SSL_RECEIVED_SHUTDOWN) {
         return 0;