Replace deprecated bcopy() with memcpy().

The bcopy() function is POSIX-specific and deprecated.  The recommended
replacement (at least for non-overlapping source and destination ranges)
is memcpy(), which is in the standard C library.

Note that the source and destination parameters are in a different order
between these two functions.
This commit is contained in:
Jeroen Vermeulen 2015-04-16 19:19:34 +07:00
parent 21a93421dc
commit 6a4943ca41
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ struct LMClient {
}
memset(&server, '\0', sizeof(server));
bcopy(hp->h_addr, (char *)&server.sin_addr, hp->h_length);
memcpy((char *)&server.sin_addr, hp->h_addr, hp->h_length);
server.sin_family = hp->h_addrtype;
server.sin_port = htons(port);

View File

@ -47,7 +47,7 @@ bool LanguageModelRemote::start(const std::string& host, int port)
}
memset(&server, '\0', sizeof(server));
bcopy(hp->h_addr, (char *)&server.sin_addr, hp->h_length);
memcpy((char *)&server.sin_addr, hp->h_addr, hp->h_length);
server.sin_family = hp->h_addrtype;
server.sin_port = htons(port);