Convert strcpy to snprintf. This is better according to Google style guidelines "runtime/printf"
This commit is contained in:
parent
77b128f2fd
commit
58bf51a6e8
4 changed files with 5 additions and 4 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue