Browse files

Use memset/memmove rather than bzero/bcopy

  • Loading branch information...
1 parent 30eaadd commit 6559da3033f20bd978a9647d21343f5978b311ec @cdolan cdolan committed Nov 13, 2012
Showing with 3 additions and 3 deletions.
  1. +3 −3 tests/test_raw_sock.cpp
View
6 tests/test_raw_sock.cpp
@@ -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);

0 comments on commit 6559da3

Please sign in to comment.