mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 18:58:51 +00:00
THRIFT-916 gcc warnings(partial) use snprintf instead of sprintf
Patch: Christian Lavoie git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1023682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
5e64d51efc
commit
d11ca5a95e
@ -264,7 +264,7 @@ void TServerSocket::listen() {
|
||||
}
|
||||
|
||||
address.sun_family = AF_UNIX;
|
||||
sprintf(address.sun_path, path_.c_str());
|
||||
snprintf(address.sun_path, sizeof(address.sun_path), "%s", path_.c_str());
|
||||
len = sizeof(address);
|
||||
|
||||
do {
|
||||
|
@ -219,7 +219,7 @@ void TSocket::openConnection(struct addrinfo *res) {
|
||||
}
|
||||
|
||||
address.sun_family = AF_UNIX;
|
||||
sprintf(address.sun_path, path_.c_str());
|
||||
snprintf(address.sun_path, sizeof(address.sun_path), "%s", path_.c_str());
|
||||
len = sizeof(address);
|
||||
ret = connect(socket_, (struct sockaddr *) &address, len);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user