Commit 37f8ce69 authored by Martin Hurton's avatar Martin Hurton

Merge pull request #470 from cdolan/master

Fixed test compilation issue by using memset/memmove rather than bzero/bcopy
parents 30eaaddd 6559da30
......@@ -49,9 +49,9 @@ int tcp_client ()
server = gethostbyname ("localhost");
assert (server);
bzero (&serv_addr, sizeof serv_addr);
memset (&serv_addr, 0, sizeof serv_addr);
serv_addr.sin_family = AF_INET;
bcopy (server->h_addr, &serv_addr.sin_addr.s_addr, server->h_length);
memmove (&serv_addr.sin_addr.s_addr, server->h_addr, server->h_length);
serv_addr.sin_port = htons (portno);
int rc = connect (sockfd, (struct sockaddr *) &serv_addr, sizeof serv_addr);
......@@ -74,7 +74,7 @@ int tcp_server ()
assert (rc == 0);
struct sockaddr_in serv_addr;
bzero (&serv_addr, sizeof serv_addr);
memset (&serv_addr, 0, sizeof serv_addr);
serv_addr.sin_family = AF_INET;
serv_addr.sin_addr.s_addr = htonl (INADDR_ANY);
serv_addr.sin_port = htons (5555);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment