Remove /* foo.c */ comments
[oweals/openssl.git] / crypto / bio / bss_acpt.c
index 16a660800d6b888b2d01facc5b1f5b358da1369c..a489ba4d2e61b62a48f165dc9215c367d22f40cf 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/bio/bss_acpt.c */
 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
  * All rights reserved.
  *
@@ -123,7 +122,7 @@ static int acpt_new(BIO *bi)
     BIO_ACCEPT *ba;
 
     bi->init = 0;
-    bi->num = INVALID_SOCKET;
+    bi->num = (int)INVALID_SOCKET;
     bi->flags = 0;
     if ((ba = BIO_ACCEPT_new()) == NULL)
         return (0);
@@ -137,11 +136,9 @@ static BIO_ACCEPT *BIO_ACCEPT_new(void)
 {
     BIO_ACCEPT *ret;
 
-    if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
+    if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL)
         return (NULL);
-
-    memset(ret, 0, sizeof(*ret));
-    ret->accept_sock = INVALID_SOCKET;
+    ret->accept_sock = (int)INVALID_SOCKET;
     ret->bind_mode = BIO_BIND_NORMAL;
     return (ret);
 }
@@ -162,11 +159,11 @@ static void acpt_close_socket(BIO *bio)
     BIO_ACCEPT *c;
 
     c = (BIO_ACCEPT *)bio->ptr;
-    if (c->accept_sock != INVALID_SOCKET) {
+    if (c->accept_sock != (int)INVALID_SOCKET) {
         shutdown(c->accept_sock, 2);
         closesocket(c->accept_sock);
-        c->accept_sock = INVALID_SOCKET;
-        bio->num = INVALID_SOCKET;
+        c->accept_sock = (int)INVALID_SOCKET;
+        bio->num = (int)INVALID_SOCKET;
     }
 }
 
@@ -202,7 +199,7 @@ static int acpt_state(BIO *b, BIO_ACCEPT *c)
             return (-1);
         }
         s = BIO_get_accept_socket(c->param_addr, c->bind_mode);
-        if (s == INVALID_SOCKET)
+        if (s == (int)INVALID_SOCKET)
             return (-1);
 
         if (c->accept_nbio) {
@@ -352,7 +349,7 @@ static long acpt_ctrl(BIO *b, int cmd, long num, void *ptr)
             if (num == 0) {
                 b->init = 1;
                 OPENSSL_free(data->param_addr);
-                data->param_addr = BUF_strdup(ptr);
+                data->param_addr = OPENSSL_strdup(ptr);
             } else if (num == 1) {
                 data->accept_nbio = (ptr != NULL);
             } else if (num == 2) {