summaryrefslogtreecommitdiffstats
path: root/apps/s_socket.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2015-05-04 18:00:15 -0400
committerRich Salz <rsalz@openssl.org>2015-05-05 22:18:59 -0400
commit16f8d4ebf0fd4847fa83d9c61f4150273cb4f533 (patch)
tree3c30094cad38433c24008c30efe3d93cf38d8ae9 /apps/s_socket.c
parent12048657a91b12e499d03ec9ff406b42aba67366 (diff)
memset, memcpy, sizeof consistency fixes
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/s_socket.c')
-rw-r--r--apps/s_socket.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/s_socket.c b/apps/s_socket.c
index bba8e0808f..1ca0d3a94a 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -252,7 +252,7 @@ static int init_client_ip(int *sock, const unsigned char ip[4], int port,
if (!ssl_sock_init())
return (0);
- memset((char *)&them, 0, sizeof(them));
+ memset(&them, 0, sizeof(them));
them.sin_family = AF_INET;
them.sin_port = htons((unsigned short)port);
addr = (unsigned long)
@@ -308,7 +308,7 @@ int init_client_unix(int *sock, const char *server)
return (0);
}
- memset((char *)&them, 0, sizeof(them));
+ memset(&them, 0, sizeof(them));
them.sun_family = AF_UNIX;
strcpy(them.sun_path, server);
@@ -410,7 +410,7 @@ static int init_server_long(int *sock, int port, char *ip, int type)
if (!ssl_sock_init())
return (0);
- memset((char *)&server, 0, sizeof(server));
+ memset(&server, 0, sizeof(server));
server.sin_family = AF_INET;
server.sin_port = htons((unsigned short)port);
if (ip == NULL)
@@ -475,7 +475,7 @@ static int init_server_unix(int *sock, const char *path)
if (s == INVALID_SOCKET)
goto err;
- memset((char *)&server, 0, sizeof(server));
+ memset(&server, 0, sizeof(server));
server.sun_family = AF_UNIX;
strcpy(server.sun_path, path);
@@ -518,7 +518,7 @@ static int do_accept(int acc_sock, int *sock, char **host)
redoit:
# endif
- memset((char *)&from, 0, sizeof(from));
+ memset(&from, 0, sizeof(from));
len = sizeof(from);
/*
* Note: under VMS with SOCKETSHR the fourth parameter is currently of