Convert strcpy to snprintf. This is better according to Google style guidelines "runtime/printf"

This commit is contained in:
Micke Prag 2012-06-19 16:18:44 +02:00
parent 77b128f2fd
commit 58bf51a6e8
4 changed files with 5 additions and 4 deletions

View file

@ -62,7 +62,7 @@ void Socket::connect(const std::wstring &server) {
}
std::string name = "/tmp/" + std::string(server.begin(), server.end());
remote.sun_family = AF_UNIX;
strcpy(remote.sun_path, name.c_str());
snprintf(remote.sun_path, sizeof(remote.sun_path), "%s", name.c_str());
len = SUN_LEN(&remote);
if (connectWrapper(d->socket, (struct sockaddr *)&remote, len) == -1) {