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:
Roger Meier 2010-10-18 08:22:57 +00:00
parent 5e64d51efc
commit d11ca5a95e
2 changed files with 2 additions and 2 deletions

View File

@ -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 {

View File

@ -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 {